#include <bits/stdc++.h>
using namespace std;
ifstream in;
ofstream out;
const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
long long n, i, j, m;
vector<pair<long long, long long> > ans;
bool viv = false;
void pr(long long l1) {
  long long l2 = n - 1 - l1;
  for (long long i = 0; i < m; i++) {
    ans.push_back({l1, i});
    ans.push_back({l2, m - 1 - i});
  }
}
void line(long long l1) {
  vector<long long> all, rall;
  for (long long i = 0; i < m; i++) all.push_back(i);
  for (long long i = 0; i < m; i++) rall.push_back(m - 1 - i);
  for (long long i = 0; i < m; i++)
    if (i & 1)
      ans.push_back({l1, all.back()}), all.pop_back();
    else
      ans.push_back({l1, rall.back()}), rall.pop_back();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    if (2 * i + 1 == n) line(i);
    if (2 * i + 1 < n) pr(i);
  }
  for (auto p : ans) cout << p.first + 1 << ' ' << p.second + 1 << '\n';
  return 0;
}
