#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
const int MOD = 1e9 + 7;
const int MAX = 600060;
const double pi = acos(-1);
void solve() {
  int N, M;
  cin >> N >> M;
  int l = 1, r = M;
  while (l <= r) {
    if (l == r) {
      vector<int> tmp;
      for (int i = 1; i < N / 2 + 2; i++) {
        tmp.push_back(i);
        if (i == N - i + 1) break;
        tmp.push_back(N - i + 1);
      }
      for (int i = 0; i < N; i++) {
        cout << tmp[i] << " ";
        cout << l << '\n';
        ;
      }
      break;
    }
    vector<int> tmp;
    for (int i = 1; i < N + 1; i++) {
      tmp.push_back(i);
      tmp.push_back(N + 1 - i);
    }
    for (int i = 0; i < 2 * N; i++) {
      if (i % 2 == 0) {
        cout << tmp[i] << " ";
        cout << l << '\n';
        ;
      } else {
        cout << tmp[i] << " ";
        cout << r << '\n';
      };
    }
    l++, r--;
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}
