#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long sx = 1, sy = 1, ex = n, ey = m;
  while (sx != ex || sy != ey) {
    cout << sx << ' ' << sy << '\n';
    cout << ex << ' ' << ey << '\n';
    sy++;
    if (sy > m) {
      sx++;
      sy = 1;
    }
    if (sx == ex && sy == ey) break;
    ey--;
    if (ey < 1) {
      ex--;
      ey = m;
    }
  }
  if (n * m % 2 != 0) {
    cout << sx << ' ' << sy << '\n';
  }
  return 0;
}
