#include <bits/stdc++.h>
using namespace std;
pair<int, int> ans[1000001];
int32_t main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) ans[(i - 1) * m + j] = {i, j};
  for (int i = 1, j = n * m; i <= j; i++, j--) {
    printf("%d %d\n", ans[i].first, ans[i].second);
    if (i == j) break;
    printf("%d %d\n", ans[j].first, ans[j].second);
  }
}
