#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 3e5 + 1;
int n, m;
pair<int, int> ans[1000000 + 10];
int main() {
  cin >> n >> m;
  int o = (n * m + 1) / 2;
  int e = (n * m) / 2;
  bool turn = false;
  int cnt = 1;
  for (int i = 1; i <= n && o; ++i) {
    if (!turn) {
      for (int j = 1; j <= m && o; ++j) {
        ans[cnt] = make_pair(i, j);
        cnt += 2;
        --o;
      }
    } else {
      for (int j = m; j >= 1 && o; --j) {
        ans[cnt] = make_pair(i, j);
        cnt += 2;
        --o;
      }
    }
    turn = !turn;
  }
  turn = true;
  cnt = 2;
  for (int i = n; i >= 1 && e; --i) {
    if (!turn) {
      for (int j = 1; j <= m && e; ++j) {
        ans[cnt] = make_pair(i, j);
        cnt += 2;
        --e;
      }
    } else {
      for (int j = m; j >= 1 && e; --j) {
        ans[cnt] = make_pair(i, j);
        cnt += 2;
        --e;
      }
    }
    turn = !turn;
  }
  for (int i = 1; i <= n * m; ++i) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  set<pair<int, int> > st;
  for (int i = 1; i < n * m; ++i) {
    st.insert(make_pair(ans[i + 1].first - ans[i].first,
                        ans[i + 1].second - ans[i].second));
  }
  assert(st.size() == n * m - 1);
  return 0;
}
