#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
vector<pair<int, int> > ans;
void solve(int n, int m, int ini, int fim) {
  if (n == 1) {
    ans.push_back(pair<int, int>(ini, 1));
    if (m == 1) return;
    int r = m;
    int l = 2;
    int turn = 0;
    while (l <= r) {
      if (turn == 0) {
        ans.push_back(pair<int, int>(ini, r));
        turn ^= 1;
        r--;
      } else {
        ans.push_back(pair<int, int>(ini, l));
        l++;
        turn ^= 1;
      }
    }
    return;
  } else if (n == 0) {
    return;
  } else {
    int l = 2;
    int r = m;
    ans.push_back(pair<int, int>(ini, 1));
    int turn = 0;
    while (l <= m or r >= 1) {
      if (turn == 0) {
        ans.push_back(pair<int, int>(fim, r));
        r--;
        turn ^= 1;
      } else {
        ans.push_back(pair<int, int>(ini, l));
        l++;
        turn ^= 1;
      }
    }
    solve(n - 2, m, ini + 1, fim - 1);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  solve(n, m, 1, n);
  for (auto it : ans) cout << it.first << " " << it.second << "\n";
}
