#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > d;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x = n - 1;
  int y = m - 1;
  for (; true;) {
    y = m;
    for (int j = 1; j < m; j++) {
      y--;
      d.push_back({+x, +y});
      y--;
      d.push_back({-x, -y});
    }
    y--;
    if (x) d.push_back({+x, +y});
    if (x < 2) break;
    x--;
    d.push_back({-x, 0});
    x--;
  }
  int X = 1, Y = 1;
  cout << 1 << " " << 1 << "\n";
  for (pair<int, int> s : d) {
    if (s.first == 0 and s.second == 0) break;
    X += s.first;
    Y += s.second;
    cout << X << " " << Y << "\n";
  }
  return 0;
}
