#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int maxn = 1e6 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n, m;
vector<pair<int, int> > v;
void solve() {
  n = read(), m = read();
  int l = 1, r = m;
  while (l <= r) {
    int x = l, y = 1;
    v.push_back(pair<int, int>(y, x));
    if (l < r) {
      int ld = 2, ru = n;
      for (int i = 1; i < 2 * n; ++i) {
        if (i & 1)
          x = r, y = ru, v.push_back(pair<int, int>(y, x)), ru--;
        else
          x = l, y = ld, v.push_back(pair<int, int>(y, x)), ld++;
      }
    } else {
      int d = 2, u = n;
      for (int i = 1; i < n; ++i) {
        if (i & 1)
          x = r, y = u, v.push_back(pair<int, int>(y, x)), u--;
        else
          x = l, y = d, v.push_back(pair<int, int>(y, x)), d++;
      }
    }
    l++, r--;
  }
  for (pair<int, int> p : v) {
    printf("%d %d\n", p.first, p.second);
  }
}
int main() {
  int T = 1;
  while (T--) solve();
}
