#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 7, mod = 1e9 + 7, inf = 1e18, MAXN = 1e6 + 7;
const double eps = 1e-9;
mt19937 rnd(time(0));
long long n, m;
void solve() {
  cin >> n >> m;
  if (n == 2 && m == 3) {
    cout << "1 1\n1 3\n1 2\n2 2\n2 3\n2 1";
    return;
  }
  for (long long i = 0; i < n / 2; ++i) {
    for (long long j = 0; j < m; ++j) {
      cout << i + 1 << " " << j + 1 << '\n';
      cout << n - i - 1 + 1 << " " << m - j - 1 + 1 << '\n';
    }
  }
  if (n % 2) {
    long long x = n / 2;
    deque<long long> have;
    cout << x + 1 << " " << 1 << '\n';
    for (long long i = 1; i < m; ++i) {
      have.push_back(i);
    }
    while (have.size()) {
      cout << x + 1 << " " << have.back() + 1 << '\n';
      have.pop_back();
      if (have.size()) {
        cout << x + 1 << " " << have.front() + 1 << '\n';
        have.pop_front();
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  long long t = 1;
  for (long long i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
