#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m;
  cin >> n >> m;
  long long int x = 1, y = 1;
  long long int dx = n - 1, dy = m - 1, neg = 0;
  vector<pair<long long int, long long int> > v;
  v.push_back({1, 1});
  for (long long int i = n - 1; i >= 0; i -= 2) {
    long long int a[2] = {i, -i};
    long long int val = 0, neg = 0;
    for (long long int j = m - 1; j > 0; j--) {
      dx = a[val];
      if (neg % 2)
        dy = -j;
      else
        dy = j;
      neg++;
      val ^= 1;
      x += dx, y += dy;
      v.push_back({x, y});
    }
    if (i == 0) break;
    dx = a[val];
    val ^= 1;
    x += dx;
    v.push_back({x, y});
    if (m % 2 == 0)
      neg = 1;
    else
      neg = 0;
    for (long long int j = 1; j <= m - 1; j++) {
      dx = a[val];
      val ^= 1;
      if (neg % 2)
        dy = -j;
      else
        dy = j;
      neg++;
      x += dx, y += dy;
      v.push_back({x, y});
    }
    dx = -(i - 1);
    if ((i - 1) > 0) {
      x += dx;
      v.push_back({x, y});
    }
  }
  for (auto i : v) cout << i.first << " " << i.second << '\n';
}
