#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1108864220")
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000007;
const double EPS = 1e-9;
const int HASH_POW = 29;
const long double PI = acos(-1.0);
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
long long nextLong(long long l, long long r) {
  uniform_int_distribution<long long> foo(l, r);
  return foo(rnd);
}
double nextDouble(double l, double r) {
  uniform_real_distribution<double> foo(l, r);
  return foo(rnd);
}
double workTime() { return double(clock()) / CLOCKS_PER_SEC; }
void myReturn(int code = 0) { exit(code); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1, j = n; i <= j; ++i, --j) {
    if (i != j) {
      for (int y = 1; y <= m; ++y) {
        printf("%d %d\n%d %d\n", i, y, j, m + 1 - y);
      }
    } else {
      for (int x = 1, y = m; x <= y; ++x, --y) {
        printf("%d %d\n", i, x);
        if (x != y) {
          printf("%d %d\n", i, y);
        }
      }
    }
  }
  myReturn();
}
