#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int n, m;
int xch[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = (1); i <= (signed)(n - 1); i++) {
    if (i % 2 == 1)
      xch[i] = (n - i);
    else
      xch[i] = -(n - i);
  }
  int l = 1, r = m;
  int cx = 1;
  bool on = false;
  while (l <= r) {
    cx = 1;
    cout << cx << " " << l << "\n";
    on = true;
    for (int i = (1); i <= (signed)(n - 1); i++) {
      cx += xch[i];
      cout << cx << " ";
      if (on)
        cout << r << "\n";
      else
        cout << l << "\n";
      on = !on;
    }
    if (l == r) break;
    cout << cx << " ";
    cout << (on ? r : l) << "\n";
    on = !on;
    for (int i = (n - 1); i >= 1; i--) {
      cx -= xch[i];
      cout << cx << " ";
      cout << (on ? r : l) << "\n";
      on = !on;
    }
    l++;
    r--;
  }
  return 0;
}
