#include <bits/stdc++.h>
using namespace std;
struct solver {
  void solve(int n, int m) {
    int i = 0;
    int d = n * m - 1;
    int px = 0;
    while (i < n * m) {
      cout << px / m + 1 << ' ' << px % m + 1 << '\n';
      px += d;
      if (d > 0)
        d = -(d - 1);
      else
        d = -d - 1;
      ++i;
    }
    assert(d <= 0);
  }
  void check(const vector<pair<int, int>>& xs) {
    set<pair<int, int>> dirs;
    for (int i = 1; i < xs.size(); ++i) {
      pair<int, int> dir = {xs[i].first - xs[i - 1].first,
                            xs[i].second - xs[i - 1].second};
      assert(dirs.find(dir) == dirs.end());
      dirs.insert(dir);
    }
  }
};
int main(int argc, char* args[]) {
  cin.sync_with_stdio(0);
  cin.tie(0);
  solver sol;
  int n, m;
  cin >> n >> m;
  sol.solve(n, m);
  return 0;
}
