#include <bits/stdc++.h>
using std::pair;
using std::printf;
using std::scanf;
const int MAX_NM = 1e6 + 10;
int n, m, curr, xa, ya, xb, yb;
pair<int, int> ans[MAX_NM];
int main() {
  scanf("%d%d", &n, &m);
  xa = 1;
  ya = 1;
  xb = n;
  yb = m;
  while (true) {
    ans[++curr] = pair<int, int>(xa, ya);
    if (++ya > m) xa++, ya = 1;
    if (curr == n * m) break;
    ans[++curr] = pair<int, int>(xb, yb);
    if (--yb < 1) xb--, yb = m;
    if (curr == n * m) break;
  }
  for (int i = 1; i <= n * m; i++)
    printf("%d %d\n", ans[i].first, ans[i].second);
}
