#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 9;
const long long inf = 1e18 + 18;
const int max6 = 1e6 + 6;
const int modx = 1e9 + 7;
const int mody = 997;
const int base = 137;
int a[1005][1005];
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> m >> n;
  int cur = 1;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j)
      if ((i + j) % 2) a[i][j] = cur++;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j)
      if (a[i][j] == 0) a[i][j] = cur++;
  bool ok = true;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= n; ++j) {
      if (j - 1 && abs(a[i][j] - a[i][j - 1]) <= 1) ok = false;
      if (j + 1 <= n && abs(a[i][j] - a[i][j + 1]) <= 1) ok = false;
      if (i - 1 && abs(a[i][j] - a[i - 1][j]) <= 1) ok = false;
      if (i + 1 <= m && abs(a[i][j] - a[i + 1][j]) <= 1) ok = false;
    }
  if (!ok) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = 1; j <= n; ++j) cout << a[i][j] << " ";
    cout << "\n";
  }
}
