#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, cnt = 0;
  cin >> n >> m;
  cnt = n * m;
  for (int i = 1; i + i <= cnt; i++) {
    printf("%d %d\n%d %d\n", (i - 1) / m + 1, (i - 1) % m + 1,
           (cnt - i) / m + 1, (cnt - i) % m + 1);
  }
  if (cnt % 2 == 1) printf("%d %d\n", n / 2 + 1, m / 2 + 1);
}
