#include <bits/stdc++.h>
using namespace std;
int sq[110][110];
int main() {
  int n, m, flag;
  while (cin >> n >> m) {
    if (n <= m)
      flag = 1;
    else {
      flag = n;
      n = m;
      m = flag;
      flag = 0;
    }
    if ((n == 1 && m == 2) || (n == 1 && m == 3) || (n == 2 && m == 2)) {
      cout << "-1" << endl;
      continue;
    }
    int num = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = i % 2 + 1; j <= m; j += 2) {
        sq[i][j] = num;
        num++;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = (i - 1) % 2 + 1; j <= m; j += 2) {
        sq[i][j] = num;
        num++;
      }
    }
    if (flag) {
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
          cout << sq[i][j] << ' ';
        }
        cout << endl;
      }
    } else {
      for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
          cout << sq[j][i] << ' ';
        }
        cout << endl;
      }
    }
  }
  return 0;
}
