#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
int n, m;
bool swp = false;
void raw(int id) {
  int l = 1, r = m;
  for (int i = 0; i < m; ++i) {
    if (id + 1 == n - id && 2 * i == m) return;
    if (!swp)
      cout << id + 1 << " " << l << "\n";
    else
      cout << l << " " << id + 1 << "\n";
    ++l;
    if (id + 1 == n - id && 2 * i + 1 == m) return;
    if (!swp)
      cout << n - id << " " << r << "\n";
    else
      cout << r << " " << n - id << "\n";
    --r;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n / 2; ++i) {
    raw(i);
  }
  if (n % 2) raw(n / 2);
  return 0;
}
