#include <bits/stdc++.h>
int mod = 998244353;
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);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int xs = 1, ys = 1, xf = n, yf = m;
  bool revs = false, revf = false;
  if (n == 1 && m == 1) {
    cout << "1 1";
    return 0;
  }
  while (1) {
    cout << xs << " " << ys << "\n";
    if (revs)
      ys--;
    else
      ys++;
    if (xs == xf && ys == yf) {
      cout << xf << " " << yf;
      break;
    } else if (xf < xs)
      break;
    if (ys == m + 1) {
      revs = true;
      xs++;
      ys--;
    } else if (ys == 0) {
      revs = false;
      xs++;
      ys++;
    }
    cout << xf << " " << yf << "\n";
    if (revf)
      yf++;
    else
      yf--;
    if (yf == 0) {
      revf = true;
      xf--;
      yf++;
    } else if (yf == m + 1) {
      yf--;
      revf = false;
      xf--;
    }
    if (xf == xs && yf == ys) {
      cout << xf << " " << yf;
      break;
    } else if (xf < xs)
      break;
  }
}
