#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool mod(long double a, long double b) { return a / b - floor(a / b); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long i1 = 1, j = 1, i2 = n, e1 = m / 2, e2 = m / 2 + 1;
  if (m % 2 != 0) e2++;
  while (j <= e1 || (m - j + 1) >= e2) {
    while (i1 <= n || i2 >= 1) {
      cout << i1 << ' ' << j << '\n';
      cout << i2 << ' ' << (m - j + 1) << '\n';
      i1++;
      i2--;
    }
    j++;
    i1 = 1;
    i2 = n;
  }
  if (m % 2 == 0) return 0;
  long long i = 1, l = n, mid = n / 2 + 1, temp = m / 2 + 1;
  cout << i << ' ' << temp << '\n';
  while (i != mid) {
    i++;
    cout << l << ' ' << temp << '\n';
    if (l == mid) break;
    l--;
    cout << i << ' ' << temp << '\n';
    if (i == mid) break;
  }
}
