#include <bits/stdc++.h>
using namespace std;
bool f;
void solve() {
  long long n, m;
  cin >> n >> m;
  bool vis[n + 1][m + 1];
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < m + 1; j++) {
      vis[i][j] = 0;
    }
  }
  long long N = n, M = m;
  n--;
  f = 1;
  long long p = 1, q = 1;
  while (p <= n || q <= m) {
    for (long long i = q; i <= m; i++) {
      if (!vis[p][i]) {
        vis[p][i] = 1;
        cout << p << " " << i << '\n';
      } else {
        return;
      }
      if (!vis[N + 1 - p][M + 1 - i]) {
        vis[N + 1 - p][M + 1 - i] = 1;
        cout << N + 1 - p << " " << M + 1 - i << '\n';
      } else {
        return;
      }
    }
    q++;
    for (long long i = p + 1; i <= n; i++) {
      if (!vis[i][m]) {
        vis[i][m] = 1;
        cout << i << " " << m << '\n';
      } else {
        return;
      }
      if (!vis[N + 1 - i][M + 1 - m]) {
        vis[N + 1 - i][M + 1 - m] = 1;
        cout << N + 1 - i << " " << M + 1 - m << '\n';
      } else {
        return;
      }
    }
    for (long long i = m - 1; i >= q; i--) {
      if (!vis[n][i]) {
        vis[n][i] = 1;
        cout << n << " " << i << '\n';
      } else {
        return;
      }
      if (!vis[N + 1 - n][M + 1 - i]) {
        vis[N + 1 - n][M + 1 - i] = 1;
        cout << N + 1 - n << " " << M + 1 - i << '\n';
      } else {
        return;
      }
    }
    for (long long i = n - 1; i > p + 1; i--) {
      if (!vis[i][q]) {
        vis[i][q] = 1;
        cout << i << " " << q << '\n';
      } else {
        return;
      }
      if (!vis[N + 1 - i][M + 1 - q]) {
        vis[N + 1 - i][M + 1 - q] = 1;
        cout << N + 1 - i << " " << M + 1 - q << '\n';
      } else {
        return;
      }
    }
    p += 2;
    q += 1;
    n -= 2;
    m -= 2;
  }
  return;
}
int main() {
  int TESTS = 1;
  while (TESTS--) {
    solve();
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
