#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int x = 1, y = 1, d1 = 1;
  if (n == 1 && m == 1) {
    cout << "1 1" << endl;
    return 0;
  }
  int X = n + 1, Y = m + 1;
  long long cnt = n * m;
  long long temp = cnt / 2;
  while (temp--) {
    cout << x << " " << y << '\n';
    cout << X - x << " " << Y - y << '\n';
    y += d1;
    if (y == m + 1) {
      y = m;
      d1 = -d1;
      x++;
    }
    if (y == 0) {
      y = 1;
      d1 = -d1;
      x++;
    }
  }
  if (cnt % 2 == 1) printf("%d %d", x, y);
  return 0;
}
