#include <bits/stdc++.h>
using namespace std;
int N, M;
int main() {
  int i, j, k;
  cin >> N >> M;
  for (j = 0, k = (N * M) - 1; k != 0;) {
    printf("%d %d\n", (1 + (j / M)), (1 + (j % M)));
    j = j + k;
    if (k < 0)
      k = -(k + 1);
    else
      k = -(k - 1);
  }
  printf("%d %d\n", (1 + (j / M)), (1 + (j % M)));
  return 0;
}
