#include <bits/stdc++.h>
using namespace std;
pair<int, int> anss[2000000];
map<pair<int, int>, int> chk;
int main() {
  int n, m;
  cin >> n >> m;
  int cc1 = 1, cc2 = -1;
  int xxx = 1;
  for (int i = 1, j = n; i <= n / 2; i++, j--) {
    if (i % 2) {
      for (int k = 1, l = m, cc = 1; cc <= 2 * m; cc++) {
        if (cc % 2) {
          anss[xxx++] = {i, k};
          k++;
        } else {
          anss[xxx++] = {j, l};
          l--;
        }
      }
    } else {
      for (int k = m, l = 1, cc = 1; cc <= 2 * m; cc++) {
        if (cc % 2) {
          anss[xxx++] = {i, k};
          k--;
        } else {
          anss[xxx++] = {j, l};
          l++;
        }
      }
    }
  }
  if (n % 2) {
    int xx = (n + 1) / 2;
    if (xx % 2) {
      for (int i = 1, cc = 1, j = m; cc <= m; cc++) {
        if (cc % 2)
          anss[xxx++] = {xx, i}, i++;
        else
          anss[xxx++] = {xx, j}, j--;
      }
    } else {
      for (int i = m, cc = 1, j = 1; cc <= m; cc++) {
        if (cc % 2)
          anss[xxx++] = {xx, i}, i--;
        else
          anss[xxx++] = {xx, j}, j++;
      }
    }
  }
  for (int i = 1; i < xxx; i++) {
    printf("%d %d\n", anss[i].first, anss[i].second);
    if (i > 1) {
      int tmpr = (anss[i].first - anss[i - 1].first);
      int tmpc = (anss[i].second - anss[i - 1].second);
      chk[{tmpr, tmpc}]++;
      if (chk[{tmpr, tmpc}] != 1) {
        assert(false);
      }
    }
  }
  return 0;
}
