#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
template <class S, class T>
istream& operator>>(istream& is, pair<S, T>& p) {
  return is >> p.first >> p.second;
}
template <class T>
istream& operator>>(istream& is, vector<T>& xs) {
  for (auto& x : xs) is >> x;
  return is;
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << p.first << " " << p.second;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& xs) {
  for (unsigned int i = 0; i < xs.size(); ++i) os << (i ? " " : "") << xs[i];
  return os;
}
template <class T>
void maxi(T& x, T y) {
  if (x < y) x = y;
}
template <class T>
void mini(T& x, T y) {
  if (x > y) x = y;
}
void debug(istringstream&) {}
template <char sep = ',', class Head, class... Tail>
void debug(istringstream& iss, Head&& head, Tail&&... tail) {
  string name;
  getline(iss, name, ',');
  cout << sep << name << "=" << head;
  debug(iss, forward<Tail>(tail)...);
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const LL MOD = 1e9 + 7;
int main() {
  int W, H;
  scanf("%d %d", &W, &H);
  puts("1 1");
  int x = 0, y = 0;
  for (int ny = H - 1; ny > 0; ny -= 2) {
    int hh = ny;
    int dx = W - 1, dy = hh;
    for (int nx = W - 1; nx > 0; --nx) {
      x += dx;
      y += dy;
      dx = -(dx > 0 ? dx - 1 : dx + 1);
      dy = -dy;
      printf("%d %d\n", x + 1, y + 1);
    }
    {
      y += dy;
      dy = -dy;
      printf("%d %d\n", x + 1, y + 1);
    }
    dx = (W % 2 == 0 ? -1 : 1);
    for (int nx = 1; nx < W; ++nx) {
      x += dx;
      y += dy;
      dx = -(dx > 0 ? dx + 1 : dx - 1);
      dy = -dy;
      printf("%d %d\n", x + 1, y + 1);
    }
    if (ny > 1) {
      y += dy + 1;
      printf("%d %d\n", x + 1, y + 1);
    }
  }
  if (H % 2) {
    int dx = W - 1;
    for (int nx = W - 1; nx > 0; --nx) {
      x += dx;
      dx = -(dx > 0 ? dx - 1 : dx + 1);
      printf("%d %d\n", x + 1, y + 1);
    }
  }
  return 0;
}
