#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ans;
int main() {
  int i, j, k, q, y, m, n;
  scanf("%d%d", &n, &m);
  int flag = 0;
  if (n > m) {
    swap(n, m);
    flag = 1;
  }
  int l = 1;
  int r = m;
  int ls = 1, us = 1, rs = 0, ds = 0;
  while (l < r) {
    if (ls == 1 && us == 1) {
      for (i = 1, j = n; i <= n; i++, j--) {
        ans.push_back(make_pair(i, l));
        ans.push_back(make_pair(j, r));
      }
      us = 0;
    } else {
      for (i = n, j = 1; i >= 1; i--, j++) {
        ans.push_back(make_pair(i, l));
        ans.push_back(make_pair(j, r));
      }
      us = 1;
    }
    l++;
    r--;
  }
  if (l == r) {
    if (us == 1) {
      for (i = 1, j = n; i < j; i++, j--) {
        ans.push_back(make_pair(i, l));
        ans.push_back(make_pair(j, l));
      }
      if (i == j) {
        ans.push_back(make_pair(i, l));
      }
    } else {
      for (i = n, j = 1; i > j; j++, i--) {
        ans.push_back(make_pair(i, l));
        ans.push_back(make_pair(j, l));
      }
      if (i == j) ans.push_back(make_pair(i, l));
    }
  }
  for (i = 0; i < ans.size(); i++) {
    if (!flag)
      printf("%d %d\n", ans[i].first, ans[i].second);
    else
      printf("%d %d\n", ans[i].second, ans[i].first);
  }
  return 0;
}
