#include <bits/stdc++.h>
using namespace std;
ostream cnull(NULL);
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cnull << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cnull << *sdbg++;
  cnull << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > odds;
  vector<pair<int, int> > evens;
  for (int j = 0; j < m / 2; ++j) {
    if (j % 2 == 0) {
      for (int i = 0; i < n; ++i) odds.emplace_back(i + 1, j + 1);
    } else {
      for (int i = n - 1; i >= 0; --i) odds.emplace_back(i + 1, j + 1);
    }
  }
  for (int j = m - 1; j >= (m + 1) / 2; --j) {
    if ((m - 1 - j) % 2 == 0) {
      for (int i = n - 1; i >= 0; --i) evens.emplace_back(i + 1, j + 1);
    } else {
      for (int i = 0; i < n; ++i) evens.emplace_back(i + 1, j + 1);
    }
  }
  vector<pair<int, int> > result;
  int wL = 0, wR = 0;
  for (int i = 0; i < ((int)(odds).size()) + ((int)(evens).size()); ++i) {
    if (i % 2 == 0)
      result.push_back(odds[wL++]);
    else
      result.push_back(evens[wR++]);
  }
  if (m % 2 == 1) {
    int mid = m / 2;
    int even = 1, odd = n;
    for (int i = 0; i < n; ++i) {
      if (i % 2 == 0)
        result.emplace_back(even++, mid + 1);
      else
        result.emplace_back(odd--, mid + 1);
    }
  }
  for (auto x : result) cout << x.first << " " << x.second << '\n';
}
