#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, r, c;
  scanf("%lld%lld", &n, &m);
  if (n % 2 == 0) {
    r = 1;
    c = 1;
    while (r != n / 2 + 1 || c != 1) {
      printf("%lld %lld\n", r, c);
      if (r <= n / 2) {
        r = n - r + 1;
        c = m - c + 1;
      } else if (c != 1) {
        r = n - r + 1;
        c = m - c + 2;
      } else {
        r = n - r + 2;
        c = 1;
      }
    }
    printf("%lld %lld\n", r, c);
    return 0;
  }
  r = 1;
  c = 1;
  while (r != n / 2 + 1 || c != 1) {
    printf("%lld %lld\n", r, c);
    if (r <= n / 2) {
      r = n - r + 1;
      c = m - c + 1;
    } else if (c != 1) {
      r = n - r + 1;
      c = m - c + 2;
    } else {
      r = n - r + 2;
      c = 1;
    }
  }
  while (c != m / 2 + 1) {
    printf("%lld %lld\n", r, c);
    if (c <= m / 2) {
      c = m - c + 1;
    } else {
      c = m - c + 2;
    }
  }
  printf("%lld %lld\n", r, c);
  return 0;
}
