#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  deque<pair<int, int>> q;
  queue<pair<int, int>> q1;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      q.push_front({i, j});
    }
  }
  bool cas = 0;
  while (q.size()) {
    pair<int, int> x;
    if (cas) {
      x = q.front();
      q.pop_front();
    } else {
      x = q.back();
      q.pop_back();
    }
    q1.push(x);
    cas = 1 - cas;
  }
  while (q1.size()) {
    pair<int, int> x = q1.front();
    q1.pop();
    printf("%d %d\n", x.first + 1, x.second + 1);
  }
  return 0;
}
