#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const long long M = 998244353;
long long n, m, i = 1, j = 1, x, y;
vector<pair<long long, long long> > v;
bool q = true, qi = true, qx = false;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  x = n;
  y = m;
  while (v.size() < n * m) {
    if (q) {
      v.push_back({i, j});
      if (qi)
        j++;
      else
        j--;
      if (j > m) {
        j = m;
        i++;
        qi = false;
      }
      if (j < 1) {
        j = 1;
        i++;
        qi = true;
      }
      q = !q;
    } else {
      v.push_back({x, y});
      if (qx)
        y++;
      else
        y--;
      if (y > m) {
        y = m;
        x--;
        qx = false;
      }
      if (y < 1) {
        y = 1;
        x--;
        qx = true;
      }
      q = !q;
    }
  }
  for (auto i : v) cout << i.first << " " << i.second << "\n";
}
