#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";
  }
}
