#include <bits/stdc++.h>
using namespace std;
int n, m;
void cal(int row1, int row2) {
  for (int i = 1; i <= m; i++)
    printf("%d %d\n%d %d\n", row1, i, row2, m + 1 - i);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= (n - 1) / 2 + 1; i++) {
    if (i < n + 1 - i) cal(i, n + 1 - i);
  }
  if (n & 1) {
    int i = 1, j = m;
    int mid = (n + 1) / 2;
    while (i < j) {
      printf("%d %d\n%d %d\n", mid, i, mid, j);
      i++;
      j--;
    }
    if (i == j) {
      printf("%d %d\n", mid, i);
    }
  }
  return 0;
}
