#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void pp(T... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
template <typename... T>
void po(T... args) {
  ((cout << args << " "), ...);
  cout << "";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int test = 1;
  for (int tt = 1; tt <= test; tt++) {
    long long int n, m;
    cin >> n >> m;
    vector<pair<long long int, long long int>> v, l, r;
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < m; j++) {
        v.push_back({i + 1, j + 1});
      }
    }
    long long int k = v.size();
    long long int i = 0;
    long long int kk = k;
    while (kk > 0) {
      pp(v[i].first, v[i].second);
      kk--;
      if (kk == 0) break;
      pp(v[k - 1 - i].first, v[k - 1 - i].second);
      kk--;
      i++;
    }
  }
  return 0;
}
