#include <bits/stdc++.h>
using namespace std;
void dfs_hor(int32_t xs, int32_t ys, int32_t xe, int32_t ye);
void dfs_ver(int32_t xs, int32_t ys, int32_t xe, int32_t ye);
void hor(int32_t xs, int32_t ys, int32_t xe, int32_t ye) {
  int32_t i = ys;
  int32_t j = ye;
  while (i <= j) {
    if (i <= j) cout << xs << " " << i++ << '\n';
    if (i <= j) cout << xs << " " << j-- << '\n';
  }
}
void ver(int32_t xs, int32_t ys, int32_t xe, int32_t ye) {
  int32_t i = xs;
  int32_t j = xe;
  while (i <= j) {
    if (i <= j) cout << i++ << " " << ys << '\n';
    if (i <= j) cout << j-- << " " << ys << '\n';
  }
}
void dfs_hor(int32_t xs, int32_t ys, int32_t xe, int32_t ye) {
  if (xs > xe || ys > ye) return;
  if (xe == xs) {
    hor(xs, ys, xe, ye);
    return;
  }
  if (ye == ys) {
    ver(xs, ys, xe, ye);
    return;
  }
  int32_t i = ys;
  int32_t j = ye;
  while (i <= ye && ys <= j) {
    cout << xs << " " << i++ << '\n';
    cout << xe << " " << j-- << '\n';
  }
  dfs_ver(xs + 1, ys, xe - 1, ye);
}
void dfs_ver(int32_t xs, int32_t ys, int32_t xe, int32_t ye) {
  if (xs > xe || ys > ye) return;
  if (xe == xs) {
    hor(xs, ys, xe, ye);
    return;
  }
  if (ye == ys) {
    ver(xs, ys, xe, ye);
    return;
  }
  int32_t i = xs;
  int32_t j = xe;
  while (i <= xe && xs <= j) {
    cout << i++ << " " << ys << '\n';
    cout << j-- << " " << ye << '\n';
  }
  dfs_hor(xs, ys + 1, xe, ye - 1);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int32_t n, m;
  cin >> n >> m;
  dfs_hor(1, 1, n, m);
  return 0;
}
