#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k;
  cin >> n >> m;
  vector<pair<int, int>> v;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      v.push_back({i, j});
    }
  }
  j = n * m - 1;
  for (i = 0; i < j; i++) {
    printf("%d %d\n", v[i].first, v[i].second);
    printf("%d %d\n", v[j].first, v[j].second);
    j--;
  }
  if (i == j) cout << v[i].first << " " << v[i].second << endl;
  return 0;
}
