#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > st;
int printd(pair<int, int> prev, pair<int, int> curr) {
  st.insert({curr.first - prev.first, curr.second - prev.second});
  cout << curr.first - prev.first << " " << curr.second - prev.second << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int x1, y1;
  int x2, y2;
  x1 = 1;
  y1 = 1;
  x2 = n;
  y2 = m;
  vector<pair<int, int> > ans;
  for (int i = 1; i * 2 <= n * m; i++) {
    ans.push_back({x1, y1});
    ans.push_back({x2, y2});
    y1++;
    y2--;
    if (y1 > m) {
      x1++;
      y1 = 1;
    }
    if (y2 < 1) {
      y2 = m;
      x2--;
    }
  }
  if ((n * m) % 2 != 0) {
    ans.push_back({x1, y1});
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
}
