#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, x, y, dx, dy, cnt = 0;
  cin >> n >> m;
  cnt = 1;
  cout << "1 1" << endl;
  dx = m - 1;
  dy = n - 1;
  x = 1;
  y = 1;
  while (cnt < n * m) {
    if (cnt % 2 != 0) {
      cout << y + dy << " " << x + dx << '\n';
      x = x + dx;
      y = y + dy;
      dx--;
    } else {
      cout << y - dy << " " << x - dx << '\n';
      x = x - dx;
      y = y - dy;
      dx--;
    }
    cnt++;
    if (cnt == n * m) break;
    if (cnt % (2 * m) == 0) {
      x = 1;
      y = y - dy + 1;
      cout << y << " " << x << '\n';
      dx = m - 1;
      dy -= 2;
      cnt++;
    }
  }
}
