#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int ct2 = n * m - 1;
  long long int ct1 = 0;
  int col, ro, pre;
  while (ct1 <= ct2) {
    col = ct1 / n + 1;
    ro = ct1 - (col - 1) * n + 1;
    if (ct1 == ct2) {
      printf("%d %d\n", ro, col);
      break;
    } else
      printf("%d %d\n", ro, col);
    col = ct2 / n + 1;
    ro = ct2 - (col - 1) * n + 1;
    printf("%d %d\n", ro, col);
    ct1++;
    ct2--;
  }
}
