#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int sx = 1;
  int sy = 1;
  int ex = n;
  int ey = m;
  for (int i = 1; i <= n * m; i++) {
    if (i % 2 == 0) {
      cout << ex << " " << ey << '\n';
      ey--;
      if (ey == 0) {
        ex--;
        ey = m;
      }
    } else {
      cout << sx << " " << sy << '\n';
      sy++;
      if (sy == m + 1) {
        sy = 1;
        sx++;
      }
    }
  }
  return 0;
}
