#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  int h = n / 2;
  for (int top = 1; top <= h; top++) {
    int bottom = n + 1 - top;
    for (int u = 0, t = 0, b = m + 1; u < 2 * m; u++) {
      if (u % 2 == 0) {
        printf("%d %d\n", top, ++t);
      } else {
        printf("%d %d\n", bottom, --b);
      }
    }
  }
  if (n % 2 == 1) {
    for (int u = 0, i = 1, j = m; u < m; u++) {
      if (u % 2 == 0) {
        printf("%d %d\n", h + 1, i++);
      } else {
        printf("%d %d\n", h + 1, j--);
      }
    }
  }
  return 0;
}
