#include <bits/stdc++.h>
using namespace std;
void fileio() {}
vector<vector<long long int>> g;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fileio();
  long long int n, m;
  cin >> n >> m;
  long long int x1 = 1, y1 = 1, x2 = n, y2 = m, ct = 0;
  while (ct < n * m) {
    if (ct & 1) {
      cout << x2 << " " << y2;
      cout << '\n';
      y2--;
    } else {
      cout << x1 << " " << y1;
      cout << '\n';
      y1++;
    }
    if (y2 == 0) {
      x2--;
      y2 = m;
    }
    if (y1 == m + 1) {
      x1++;
      y1 = 1;
    }
    ct++;
  }
  return 0;
}
