#include <bits/stdc++.h>
using namespace std;
int n, m;
bool inline operator<(pair<int, int> a, pair<int, int> b) {
  return a.first != b.first ? a.first < b.first : a.second < b.second;
}
bool inline operator==(pair<int, int> a, pair<int, int> b) {
  return a.first == b.first && a.second == b.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  int d = 1, cnt = 0;
  pair<int, int> s = {1, 1}, e = {n, m};
  while (cnt < n * m) {
    if (s == e) {
      cout << s.first << ' ' << s.second << '\n';
      ++cnt;
    } else {
      cout << s.first << ' ' << s.second << '\n';
      cout << e.first << ' ' << e.second << '\n';
      cnt += 2;
    }
    if (d == 1 ? s.second < m : s.second > 1) {
      s.second += d;
      e.second -= d;
    } else {
      d = 0 - d;
      ++s.first;
      --e.first;
    }
  }
}
