#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n >> m;
  vector<pair<int, int> > vec;
  for (int l = 0, r = m - 1; l <= r; l++, r--) {
    if (l != r) {
      int x = 0, y = n - 1;
      for (int j = 0; j < n; j++) {
        vec.push_back(make_pair(x, l));
        vec.push_back(make_pair(y, r));
        x++;
        y--;
      }
    } else {
      int x = 0, y = n - 1;
      while (x <= y) {
        if (x == y) {
          vec.push_back(make_pair(x, l));
        } else {
          vec.push_back(make_pair(x, l));
          vec.push_back(make_pair(y, l));
        }
        x++;
        y--;
      }
    }
  }
  set<pair<int, int> > st;
  set<pair<int, int> > dis;
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i].first + 1 << " " << vec[i].second + 1 << "\n";
    dis.insert(vec[i]);
    assert(vec[i].first >= 0 and vec[i].first < n);
    assert(vec[i].second >= 0 and vec[i].second < m);
    if (i > 0) {
      int a = vec[i].first - vec[i - 1].first;
      int b = vec[i].second - vec[i - 1].second;
      if (st.find(make_pair(a, b)) != st.end()) {
        assert(1 == 0);
      }
      st.insert(make_pair(a, b));
    }
  }
  assert(dis.size() == n * m);
}
