#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
using namespace std;
using ll = long long;
using ld = long double;
using itn = int;
mt19937 gen(41);
const ld eps = 1e-7;
const ll MAXN = 2097152;
const ll INF = 1e17;
ll gcd(ll a, ll b) {
  a = abs(a);
  b = abs(b);
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll binpow(ll a, ll n) {
  ll binpow_mod = 1e9 + 7;
  ll res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
    a %= binpow_mod;
    res %= binpow_mod;
  }
  return res;
}
struct Point {
  ll x, y;
  bool z;
  void scan() { cin >> x >> y; }
  Point(ll X = 0, ll Y = 0, bool Z = 0) {
    x = X;
    y = Y;
    z = Z;
  }
  ll operator*(Point &a) { return x * a.y - y * a.x; }
  bool operator==(Point &a) { return x == a.x && y == a.y; }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (n * m) / 2; i++) {
    cout << i / m + 1 << ' ' << i % m + 1 << '\n';
    cout << n - i / m << ' ' << m - i % m << '\n';
  }
  if ((n * m) % 2 == 1) cout << n / 2 + 1 << ' ' << m / 2 + 1 << '\n';
  return 0;
}
