#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(0));
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 1e5 + 7;
const double PI = acos(-1.);
const double EPS = 1e-8;
const int MOD = 1000 * 1000 * 1000 + 7;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int x = 0, u = 0, i = n - 1, bkznm = m - 1;
  vector<pair<int, int> > naui;
  for (int goryt = 0; goryt < (n * m); ++goryt) {
    if (goryt % 2 == 0) {
      naui.push_back({x, u});
      ++u;
      if (u == m) {
        u = 0;
        ++x;
      }
    } else {
      naui.push_back({i, bkznm});
      --bkznm;
      if (bkznm == -1) {
        --i;
        bkznm = m - 1;
      }
    }
  }
  for (int i = 0; i < (((int)naui.size())); ++i) {
    printf("%d %d\n", naui[i].first + 1, naui[i].second + 1);
  }
  return 0;
}
