#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > ans;
  bool inv = false;
  if (n > m) {
    swap(n, m);
    inv = true;
  }
  for (int j = (1); j <= (m / 2); j++) {
    if (n == 1) {
      ans.push_back(make_pair(1, j));
      ans.push_back(make_pair(1, m - j + 1));
    } else {
      for (int i = (1); i <= (n); i++) {
        ans.push_back(make_pair(i, j));
        ans.push_back(make_pair(n - i + 1, m - j + 1));
      }
    }
  }
  if (m & 1) {
    int j = m / 2 + 1;
    for (int i = (1); i <= (n / 2); i++) {
      ans.push_back(make_pair(i, j));
      ans.push_back(make_pair(n - i + 1, j));
    }
    if (n & 1) {
      ans.push_back(make_pair(n / 2 + 1, m / 2 + 1));
    }
  }
  for (auto p : ans) {
    if (inv) {
      cout << p.second << " " << p.first << "\n";
    } else {
      cout << p.first << " " << p.second << "\n";
    }
  }
  return 0;
}
