#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O3")
long long int i1 = 1, i2 = 1, j = 1, j2 = 1;
long long int one = 0, two = 1;
long long int n, m;
void func1() {
  if (one & 1) {
    i1--;
    if (i1 == 0) one ^= 1, i1 = 1, j++;
  } else {
    i1++;
    if (i1 == n + 1) one ^= 1, i1 = n, j++;
  }
}
void func2() {
  if (two & 1) {
    i2--;
    if (i2 == 0) two ^= 1, i2 = 1, j2--;
  } else {
    i2++;
    if (i2 == n + 1) two ^= 1, i2 = n, j2--;
  }
}
int main() {
  scanf("%lld %lld", &n, &m);
  i2 = n, j2 = m;
  long long int cnt = n * m, p = 0;
  for (long long int a = 0; a < cnt; a++) {
    if (p & 1) {
      printf("%lld %lld\n", i2, j2);
      func2();
    } else {
      printf("%lld %lld\n", i1, j);
      func1();
    }
    p ^= 1;
  }
  return 0;
}
