#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238462643383;
long long maxx(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long minn(long long a, long long b) { return a + b - maxx(a, b); }
long long Ceil(long long a, long long b) {
  if (a % b == 0) return a / b;
  return a / b + 1;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  long long n, m;
  cin >> n >> m;
  long long l = 0, r = m - 1;
  long long l1 = 0, r1 = n - 1;
  bool flag = true;
  bool lflag1 = true;
  bool rflag1 = false;
  vector<vector<bool> > a(n, vector<bool>(m, false));
  while (true) {
    if (flag) {
      flag = flag ^ true;
      if (l1 < 0) {
        lflag1 = true;
        l++;
        if (a[0][l]) break;
        a[0][l] = true;
        cout << 1 << " " << l + 1 << "\n";
        l1 = 1;
        continue;
      }
      if (l1 > n - 1) {
        lflag1 = false;
        l++;
        if (a[n - 1][l]) break;
        a[n - 1][l] = true;
        cout << n << " " << l + 1 << "\n";
        l1 = n - 2;
        continue;
      }
      if (a[l1][l]) break;
      a[l1][l] = true;
      cout << l1 + 1 << " " << l + 1 << "\n";
      l1 += ((lflag1) ? 1 : -1);
    } else {
      flag = flag ^ true;
      if (r1 < 0) {
        rflag1 = true;
        r--;
        if (a[0][r]) break;
        a[0][r] = true;
        cout << 1 << " " << r + 1 << "\n";
        r1 = 1;
        continue;
      }
      if (r1 > n - 1) {
        rflag1 = false;
        r--;
        if (a[n - 1][r]) break;
        a[n - 1][r] = true;
        cout << n << " " << r + 1 << "\n";
        r1 = n - 2;
        continue;
      }
      if (a[r1][r]) break;
      a[r1][r] = true;
      cout << r1 + 1 << " " << r + 1 << "\n";
      r1 += ((rflag1) ? 1 : -1);
    }
  }
}
