#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y;
  cin >> n >> m;
  if (n == 1 and m == 1) {
    cout << 1 << " " << 1;
    return 0;
  } else if (n == 1) {
    y = 1;
    x = 1;
    while (y <= m - y + 1) {
      cout << x << " " << y << "\n";
      if (y != m - y + 1) cout << x << " " << m - y + 1 << "\n";
      y = y + 1;
    }
    return 0;
  } else if (m == 1) {
    y = 1;
    x = 1;
    while (x <= n - x + 1) {
      cout << x << " " << y << "\n";
      if (x != n - x + 1) cout << n - x + 1 << " " << y << "\n";
      x = x + 1;
    }
    return 0;
  }
  int line = n / 2, col;
  x = 1;
  while (x <= line) {
    y = 1;
    while (y <= m) {
      cout << x << " " << y << "\n";
      cout << n - x + 1 << " " << m - y + 1 << "\n";
      y = y + 1;
    }
    x = x + 1;
  }
  if (n % 2 == 1) {
    y = 1;
    x = n / 2 + 1;
    while (y <= m - y + 1) {
      cout << x << " " << y << "\n";
      if (y != m - y + 1) cout << x << " " << m - y + 1 << "\n";
      y = y + 1;
    }
  }
  return 0;
}
