#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma comment(linker, "/stack:200000000")
using namespace std;
const int mod0 = 1e9 + 7;
const long long mod1 = 998244353;
const long long mod2 = 1e9 + 9;
const long long mod3 = 2147483647;
const int sz = 512 * 1024;
const long long inf = 2 * 1024 * 1024 * 1023 - 1;
const long long INF = inf * inf;
const long double eps = 1e-7;
const long long K = 1e12;
void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(16);
}
void solve() {
  int n, m;
  cin >> n >> m;
  int i1 = 1, i2 = n, j1 = 2, j2 = m - 1;
  cout << 1 << " " << 1 << '\n';
  if (n * m == 1) return;
  cout << n << " " << m << '\n';
  while (i1 <= i2) {
    if (j2 == 0) {
      i1++, i2--;
      j1 = 1, j2 = m;
    }
    if (i1 > i2) break;
    if (i1 == i2 && j1 > j2) break;
    cout << i1 << " " << j1 << '\n';
    if (i1 != i2 || j1 != j2) cout << i2 << " " << j2 << '\n';
    j1++, j2--;
  }
}
int main() {
  init();
  solve();
  return 0;
}
