#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int cx = 1, cy = 1;
  vector<vector<bool>> ta(n + 1, vector<bool>(m + 1, false));
  ta[1][1] = true;
  cout << 1 << " " << 1 << "\n";
  for (int i = 1; i < n * m; i++) {
    int nx = n - cx + 1, ny = m - cy + 1;
    if (ta[nx][ny]) {
      nx++;
      if (nx == (n + 1)) {
        nx = 1;
        ny++;
      }
    }
    cout << nx << " " << ny << "\n";
    ta[nx][ny] = true;
    cx = nx, cy = ny;
  }
  return 0;
}
