#include <bits/stdc++.h>
using namespace std;
queue<pair<int, int> > L, R;
int **M;
int ori, n, m;
bool play(pair<int, int> &p, int &ori) {
  for (int i = 0; i < 2; i++) {
    if (ori == 0) {
      if (M[p.first + 1][p.second] > 0)
        ori++;
      else {
        p = {p.first + 1, p.second};
        return 1;
      }
    }
    if (ori == 1) {
      if (M[p.first][p.second + 1] > 0)
        ori++;
      else {
        p = {p.first, p.second + 1};
        return 1;
      }
    }
    if (ori == 2) {
      if (M[p.first - 1][p.second] > 0)
        ori++;
      else {
        p = {p.first - 1, p.second};
        return 1;
      }
    }
    if (ori == 3) {
      if (M[p.first][p.second - 1] > 0)
        ori = 0;
      else {
        p = {p.first, p.second - 1};
        return 1;
      }
    }
  }
  return 0;
}
void f(pair<int, int> l, pair<int, int> r, int oril, int orir) {
  L.push(l);
  if (l != r)
    R.push(r);
  else
    return;
  M[l.first][l.second] = 1;
  M[r.first][r.second] = 2;
  if (play(l, oril) == 0) return;
  if (play(r, orir) == 0) return;
  f(l, r, oril, orir);
}
int main() {
  scanf("%d%d", &n, &m);
  M = new int *[n + 2];
  for (int i = 0; i < n + 2; i++) {
    M[i] = new int[m + 2];
    for (int j = 0; j < m + 2; j++) M[i][j] = 0;
  }
  for (int i = 0; i < n + 2; i++) M[i][0] = M[i][m + 1] = 1;
  for (int i = 0; i < m + 2; i++) M[0][i] = M[n + 1][i] = 1;
  f({1, 1}, {n, m}, 0, 2);
  while (!L.empty()) {
    printf("%d %d\n", L.front().first, L.front().second);
    L.pop();
    if (!R.empty()) {
      printf("%d %d\n", R.front().first, R.front().second);
      R.pop();
    }
  }
}
