#include <bits/stdc++.h>
#pragma GCC optimize(2)
template <typename T>
bool chkmax(T &x, T y) {
  return x < y ? x = y, true : false;
}
template <typename T>
bool chkmin(T &x, T y) {
  return x > y ? x = y, true : false;
}
using namespace std;
inline int read() {
  int x = 0;
  int f = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    f |= (ch == '-') ? 1 : 0;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return f ? -x : x;
}
int n, m;
int main() {
  n = read();
  m = read();
  int cur1 = 1, cur2 = 1;
  int cur = 0;
  while (cur < n * m) {
    if (!(cur & 1)) {
      printf("%d %d\n", cur1, cur2);
    } else {
      printf("%d %d\n", n - cur1 + 1, m - cur2 + 1);
    }
    if (cur & 1) {
      if (cur2 == m && (cur1 & 1)) {
        ++cur1;
      } else if (cur2 == 1 && !(cur1 & 1)) {
        ++cur1;
      } else {
        if (cur1 & 1)
          ++cur2;
        else
          --cur2;
      }
    }
    ++cur;
  }
}
