#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > Ans;
void Solve(int n, int m, int Ystaff = 0) {
  pair<int, int> p1 = pair<int, int>(0, Ystaff);
  pair<int, int> p2 = pair<int, int>(n - 1, Ystaff + m - 1);
  int rep = (m == 1 ? n : 2 * n);
  for (int i = 1; i <= rep; ++i) {
    if (i & 1)
      Ans.push_back(p1), p1.first++;
    else
      Ans.push_back(p2), p2.first--;
  }
  if (m > 2) Solve(n, m - 2, Ystaff + 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  Solve(n, m);
  for (pair<int, int> p : Ans) printf("%d %d\n", p.first + 1, p.second + 1);
}
