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