#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > vv;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, n, m;
  cin >> n >> m;
  long long r1 = 1, r2 = n, c1 = 1, c2 = m;
  while (r1 <= r2) {
    if (r1 == r2) {
      long long len = m - 1;
      long long cur = 1;
      long long bit = 1;
      vv.push_back({r1, cur});
      while (len > 0) {
        cur += (bit * len);
        vv.push_back({r1, cur});
        len--;
        bit = (-bit);
      }
    } else {
      while (c2 >= 1) {
        vv.push_back({r1, c1});
        vv.push_back({r2, c2});
        c1++;
        c2--;
      }
    }
    r1 = min(r1, r2);
    r2 = max(r1, r2);
    r1++;
    r2--;
    c1 = 1;
    c2 = m;
  }
  for (auto it : vv) cout << it.first << " " << it.second << "\n";
  return 0;
}
