#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d %d", &n, &m);
  int i = 1, j = m;
  while (i < j) {
    int x = 1, y = n;
    while (x <= n) printf("%d %d\n", x++, i), printf("%d %d\n", y--, j);
    i++;
    j--;
  }
  if (m % 2) {
    int x = (m + 1) / 2, y = 1, z = n;
    while (y < z) printf("%d %d\n", y++, x), printf("%d %d\n", z--, x);
    if (n % 2) printf("%d %d\n", (n + 1) / 2, (m + 1) / 2);
  }
  return 0;
}
