#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int oo = ~0u >> 2, mo = (int)1e9 + 7;
const int mn = 110;
int a[mn][mn];
int n, m, tt(0);
int main() {
  cin >> n >> m;
  if (n * m == 3 || n * m == 2 || (n == 2 && m == 2))
    cout << -1 << endl;
  else {
    for (int k = 1; k >= 0; --k)
      for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= m; ++j)
          if (((i + j) & 1) == k) a[i][j] = ++tt;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) {
        printf("%d", a[i][j]);
        if (j == m)
          printf("\n");
        else
          printf(" ");
      }
  }
}
