#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  long long pr = n * m;
  long long l = 1, r = pr;
  for (long long i = 1; i <= pr; ++i) {
    long long j = l;
    if (i % 2 == 0) {
      j = r;
      r--;
    } else {
      l++;
    }
    long long x = j % m, y = 1 + j / m;
    if (!x) {
      x = m;
      y -= 1;
    }
    cout << y << ' ' << x << "\n";
  }
}
