#include <bits/stdc++.h>
int m, n, l, r;
int main() {
  scanf("%d%d", &n, &m);
  for (l = 1, r = n * m; l <= r;) {
    if (l <= r) printf("%d %d\n", (l - 1) / m + 1, (l - 1) % m + 1), l++;
    if (l <= r) printf("%d %d\n", (r - 1) / m + 1, (r - 1) % m + 1), r--;
  }
  return 0;
}
