#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000010], b[2];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    a[2 * i - 1] = i;
    a[2 * (m - i + 1)] = i;
  }
  for (int i = 0; i < n / 2; i++) {
    b[1] = i + 1;
    b[0] = n - i;
    for (int j = 1; j <= 2 * m; j++) printf("%d %d\n", b[j % 2], a[j]);
  }
  if (n % 2 == 1)
    for (int i = 1; i <= m; i++) printf("%d %d\n", (n + 1) / 2, a[i]);
  return 0;
}
