#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
int n, m;
void solve(int cux, int cuy, int p, int q) {
  if (p < cux || q < cuy) return;
  if (p == cux) {
    int tmp = q + 1;
    for (int i = cuy; i <= q; i++) {
      if (tmp <= i) break;
      printf("%d %d\n", cux, i);
      tmp = q - (i - cuy);
      if (tmp <= i) break;
      printf("%d %d\n", p, tmp);
    }
    return;
  }
  if (q == cuy) {
    int tmp = p + 1;
    for (int i = cux; i <= p; i++) {
      if (tmp <= i) break;
      printf("%d %d\n", i, cuy);
      tmp = p - (i - cux);
      if (tmp <= i) break;
      printf("%d %d\n", tmp, q);
    }
    return;
  }
  printf("%d %d\n", cux, cuy);
  printf("%d %d\n", p, q);
  printf("%d %d\n", cux, q);
  printf("%d %d\n", p, cuy);
  if (n <= 2 || (n - 2) % 6 != 0) {
    for (int i = q - 1; i >= cuy + 1; i--) {
      printf("%d %d\n", cux, i);
      printf("%d %d\n", p, cuy + (q - i));
    }
  } else {
    int mk = 0, tyfsb;
    for (int i = q - 1; i >= cuy + 2; i--) {
      printf("%d %d\n", cux, i - mk);
      printf("%d %d\n", p, cuy + (q - i));
      if (i - 1 == cuy + (q - i)) {
        mk = 1;
        tyfsb = i - 1;
      }
    }
    printf("%d %d\n", cux, tyfsb);
    printf("%d %d\n", p, q - 1);
  }
  for (int i = cux + 1; i <= p - 1; i++) {
    printf("%d %d\n", i, cuy);
    printf("%d %d\n", p - (i - cux), q);
  }
  solve(cux + 1, cuy + 1, p - 1, q - 1);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= m; j++) {
      printf("%d %d\n", i, j);
      printf("%d %d\n", n - i + 1, m - j + 1);
    }
  }
  if (n & 1) {
    int row = n / 2 + 1;
    int limit = m;
    if (m % 2 == 0) limit /= 2;
    for (int j = 1; j <= limit; j++) {
      printf("%d %d\n", row, j);
      if (j == m - j + 1) break;
      printf("%d %d\n", row, m - j + 1);
      if (j + 1 > m - j + 1) break;
    }
  }
  return 0;
}
