#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x = 1, y = 1, s = 1, nn = n, mm = m;
  while (s <= n * m) {
    if (s % 2 == 0) {
      printf("%d %d\n", nn, mm);
      mm--;
      if (mm < 1) mm = m, nn--;
    } else {
      printf("%d %d\n", x, y);
      y++;
      if (y > m) y = 1, x++;
    }
    s++;
  }
  return 0;
}
