#include <bits/stdc++.h>
using namespace std;
void files() {
  freopen("1.in", "r", stdin);
  freopen("1.out", "w", stdout);
  return;
}
const int MXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
void sol() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n / 2; ++i) {
    int rowx = i, colx = 1;
    int rowy = n - i + 1, coly = m;
    for (int j = 1; j <= m; ++j) {
      cout << rowx << " " << colx << "\n";
      cout << rowy << " " << coly << "\n";
      colx++;
      coly--;
    }
  }
  if (n & 1) {
    int rowx = n / 2 + 1, colx = 1;
    int rowy = n / 2 + 1, coly = m;
    for (int i = 1; i <= m / 2; ++i) {
      cout << rowx << " " << colx << "\n";
      cout << rowy << " " << coly << "\n";
      colx++;
      coly--;
    }
    if (m & 1) cout << rowx << " " << colx << "\n";
  }
}
int main() {
  int tcase = 1;
  while (tcase--) {
    sol();
  }
}
