#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T t) {
  return t < 0 ? -t : t;
}
const long long modn = 1000000007;
inline long long mod(long long x) { return x % modn; }
const int MAXN = 212345;
int n, m, k;
map<pair<int, int>, bool> seen;
int main() {
  scanf("%d%d", &n, &m);
  int i = 1, j = 1;
  int ii = n, jj = m;
  int t = 0;
  pair<int, int> lst = {-1, -1};
  while (i < ii || (i == ii && j <= jj)) {
    if (!t) {
      if (lst.first != -1) {
        assert(seen[make_pair(i - lst.first, j - lst.second)] == false);
        seen[make_pair(i - lst.first, j - lst.second)] = true;
      }
      printf("%d %d\n", i, j);
      lst = {i, j};
      if (j < m)
        j++;
      else {
        j = 1;
        i++;
      }
    } else {
      printf("%d %d\n", ii, jj);
      if (lst.first != -1) {
        assert(seen[make_pair(ii - lst.first, jj - lst.second)] == false);
        seen[make_pair(ii - lst.first, jj - lst.second)] = true;
      }
      lst = {ii, jj};
      if (jj == 1) {
        jj = m;
        ii--;
      } else
        jj--;
    }
    t ^= 1;
  }
}
