#include <bits/stdc++.h>
using namespace std;
void solve(int n, int m, int k) {
  if (n == 1) {
    for (int i = 0; i < m; i++)
      cout << k + 1 << " " << (i % 2 ? m - i / 2 : i / 2 + 1) << "\n";
    return;
  }
  for (int i = 0; i < 2 * m; i++)
    cout << (i % 2 ? k + n : k + 1) << " " << (i % 2 ? m - i / 2 : i / 2 + 1)
         << "\n";
  if (n == 2) return;
  solve(n - 2, m, k + 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  solve(n, m, 0);
  return 0;
}
