#include <bits/stdc++.h>
long long int mod = 1000000000 + 7;
long long int inf = 1000000000000000000;
using namespace std;
mt19937 unlucko(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  bool a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      a[i][j] = false;
    }
  }
  int x = 0, y = 0, xx = n - 1, yy = m - 1;
  while (!a[x][y]) {
    cout << x + 1 << " " << y + 1 << "\n";
    a[x][y] = true;
    y++;
    if (y == m) y = 0, ++x;
    if (a[xx][yy]) break;
    a[xx][yy] = true;
    cout << xx + 1 << " " << yy + 1 << "\n";
    yy--;
    if (yy == -1) yy = m - 1, xx--;
  }
}
