#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, m;
void work() {
  n = read(), m = read();
  int x = 1, y = n;
  while (x <= y) {
    if (x == y) {
      int l = 1, r = m;
      while (l <= r) {
        if (l != r)
          printf("%d %d\n%d %d\n", x, l, x, r);
        else
          printf("%d %d\n", x, l);
        l++;
        r--;
      }
    } else {
      for (register int l = (int)(1); l <= (int)(m); l++) {
        printf("%d %d\n%d %d\n", x, l, y, m + 1 - l);
      }
    }
    x++;
    y--;
  }
}
int main() { work(); }
