#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  v.resize(n * m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      v[m * (i - 1) + j - 1] = {i, j};
    }
  }
  bool low = true;
  int l = 0, r = m * n - 1;
  while (r >= l) {
    pair<int, int> u;
    if (low) {
      u = v[l];
      l++;
      low = false;
    } else {
      u = v[r];
      r--;
      low = true;
    }
    cout << u.first << " " << u.second << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
}
