#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 5 * (long long)1e5 + 10;
long long n, m;
set<pair<long long, long long> > s;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= m; ++j) {
      s.emplace(i, j);
    }
  }
  long long p = 0;
  while (!s.empty()) {
    if (p == 0) {
      pair<long long, long long> x = *s.begin();
      s.erase(s.begin());
      cout << x.first << ' ' << x.second << '\n';
    } else {
      pair<long long, long long> y = *s.rbegin();
      s.erase(--s.end());
      cout << y.first << ' ' << y.second << '\n';
    }
    p ^= 1;
  }
  return 0;
}
