#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 1, mod = 1e9 + 7;
int a[sz];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int i, j, n, m, lj, tot = 0;
  cin >> n >> m;
  if (n == m && n == 1) {
    cout << "1 1\n";
  } else if (n == 1) {
    if (n & 1) {
      for (j = 1; j <= m / 2; j++) {
        cout << "1 " << j << "\n";
        cout << "1 " << m - j + 1 << "\n";
      }
      if (m & 1) cout << "1 " << (m + 1) / 2 << "\n";
    }
  } else {
    pair<int, int> p1 = {1, 1}, p2 = {n, m};
    for (i = 1; i <= n / 2; i++) {
      for (j = 1; j <= m; j++) {
        cout << i << " " << j << "\n";
        cout << n - i + 1 << " " << m - j + 1 << "\n";
      }
    }
    if (n & 1) {
      i = (n + 1) / 2;
      lj = 1;
      for (j = m; j > (m + 1) / 2; j--) {
        cout << i << " " << j << "\n";
        cout << i << " " << lj++ << "\n";
      }
      if (m & 1) cout << i << " " << (m + 1) / 2 << "\n";
    }
  }
}
