#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, sum, ansx[1000005], ansy[1000005];
int read() {
  char ch = getchar();
  int xx = 0;
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    xx = xx * 10 + ch - '0';
    ch = getchar();
  }
  return xx;
}
int main() {
  n = read();
  m = read();
  for (i = 1; i <= n * m; i += n * 2) {
    sum++;
    for (j = 1; j <= n * 2; j++)
      if (j & 1)
        ansy[i + j - 1] = sum;
      else
        ansy[i + j - 1] = m - sum + 1;
  }
  for (i = 1; i <= n * m; i += n * 2) {
    sum = 0;
    for (j = 1; j <= n * 2; j++) {
      if (j & 1) {
        sum++;
        ansx[i + j - 1] = sum;
      } else
        ansx[i + j - 1] = n - sum + 1;
    }
  }
  for (i = 1; i <= n * m; i++) printf("%d %d\n", ansx[i], ansy[i]);
  return 0;
}
