#include <bits/stdc++.h>
using namespace std;
long long readll() {
  bool minus = false;
  long long result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    minus = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (minus)
    return -result;
  else
    return result;
}
int readint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int MX = 2e5 + 100;
int main() {
  int n, m, x1, x2, y1, y2, i, j;
  int mx;
  scanf("%d%d", &n, &m);
  if (n == 1) {
    for (i = 0, y1 = 1, y2 = m; i < m; i++) {
      if (i % 2 == 0) {
        printf("%d %d\n", 1, y1);
        y1++;
      } else {
        printf("%d %d\n", 1, y2);
        y2--;
      }
    }
    return 0;
  }
  if (m == 1) {
    for (i = 0, x1 = 1, x2 = n; i < n; i++) {
      if (i % 2 == 0) {
        printf("%d %d\n", x1, 1);
        x1++;
      } else {
        printf("%d %d\n", x2, 1);
        x2--;
      }
    }
    return 0;
  }
  for (i = 1, x1 = 1, x2 = n; i <= (n + 1) / 2; i++, x1++, x2--) {
    printf("%d %d\n", x1, 1);
    if (x1 == x2)
      mx = m;
    else
      mx = 2 * m;
    for (j = 1, y1 = 2, y2 = m; j < mx; j++) {
      if (j % 2 == 0) {
        printf("%d %d\n", x1, y1);
        y1++;
      } else {
        printf("%d %d\n", x2, y2);
        y2--;
      }
    }
  }
  return 0;
}
