#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long mod = 1e9 + 7;
struct point {
  int x, y;
};
void solve(int n, int m, int x, int y) {
  int i, j;
  queue<point> q[5];
  if (n == 1) {
    int l = 1;
    int r = m;
    int i;
    for (i = 1; i <= m; i++) {
      if (i % 2 == 1) {
        cout << 1 + x << " " << l + y << endl;
        l++;
      } else {
        cout << 1 + x << " " << r + y << endl;
        r--;
      }
    }
  } else {
    for (i = 1; i <= m; i++) {
      point temp;
      temp.x = x + 1;
      temp.y = y + i;
      q[1].push(temp);
    }
    for (i = m; i >= 1; i--) {
      point temp;
      temp.x = x + n;
      temp.y = y + i;
      q[2].push(temp);
    }
    for (i = 1; i <= 2 * m; i++) {
      point temp;
      if (i % 2 == 1) {
        temp = q[1].front();
        q[1].pop();
      } else {
        temp = q[2].front();
        q[2].pop();
      }
      printf("%d %d\n", temp.x, temp.y);
    }
  }
}
int main() {
  int nowx = 0;
  int nowy = 0;
  int n, m;
  cin >> n >> m;
  while (n > 0) {
    solve(n, m, nowx, nowy);
    n -= 2;
    nowx++;
  }
}
