#include <bits/stdc++.h>
using namespace std;
const int64_t N = 1e6 + 7;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int64_t n, m;
  cin >> n >> m;
  for (int64_t i = 0; 2 * i < n * m - 1; i++)
    cout << 1 + i / m << " " << 1 + i % m << "\n"
         << 1 + (n * m - 1 - i) / m << " " << 1 + (n * m - 1 - i) % m << "\n";
  if ((n * m - 1) % 2 == 0) cout << 1 + n / 2 << " " << 1 + m / 2;
}
