#include <bits/stdc++.h>
using namespace std;
const int maxn = (1e6) + 7;
int n, m, L, R, size, ansx[maxn], ansy[maxn];
int main() {
  scanf("%d%d", &n, &m);
  L = 1, R = m;
  for (int i = 1; i <= m >> 1; i++) {
    for (int j = 1; j <= n; j++) {
      ++size;
      ansx[size] = j, ansy[size] = L;
      ++size;
      ansx[size] = n - j + 1, ansy[size] = R;
    }
    ++L, --R;
  }
  if (m & 1) {
    L = 1, R = n;
    for (int i = 1; i <= n >> 1; i++) {
      ++size;
      ansx[size] = L, ansy[size] = (m + 1) >> 1;
      ++size;
      ansx[size] = R, ansy[size] = (m + 1) >> 1;
      ++L, --R;
    }
    if (L == R) ++size, ansx[size] = L, ansy[size] = (m + 1) >> 1;
  }
  for (int i = 1; i <= size; i++) printf("%d %d\n", ansx[i], ansy[i]);
  return 0;
}
