#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 2 && m == 3) {
    cout << "1 1\n1 3\n1 2\n2 2\n2 3\n2 1";
    return 0;
  }
  for (int i = 0; i < n / 2; ++i) {
    for (int j = 0; j < m; ++j) {
      cout << i + 1 << " " << j + 1 << '\n';
      cout << n - i - 1 + 1 << " " << m - j - 1 + 1 << '\n';
    }
  }
  if (n % 2) {
    int x = n / 2;
    deque<int> box;
    cout << x + 1 << " " << 1 << '\n';
    for (int i = 1; i < m; ++i) {
      box.push_back(i);
    }
    while (box.size()) {
      cout << x + 1 << " " << box.back() + 1 << '\n';
      box.pop_back();
      if (box.size()) {
        cout << x + 1 << " " << box.front() + 1 << '\n';
        box.pop_front();
      }
    }
  }
  return 0;
}
