#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  int n, m;
  cin >> n >> m;
  int d = n, u = 1;
  while (u <= d) {
    if (d != u) {
      for (int i = 1; i <= m; ++i) {
        cout << u << ' ' << i << '\n';
        cout << d << ' ' << m - i + 1 << '\n';
      }
    } else {
      int l = 1, r = m;
      while (l <= r) {
        if (l == r) {
          cout << u << ' ' << l << '\n';
          return;
        }
        cout << u << ' ' << l << ' ' << u << ' ' << r << '\n';
        ++l, --r;
      }
    }
    ++u;
    --d;
  }
}
