#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[107][107], k = 0;
  cin >> n >> m;
  for (int i = n - 1; i >= 0; i--)
    for (int j = m - 1; j >= 0; j--)
      if ((i + j) % 2 == 0) a[i][j] = ++k;
  for (int i = n - 1; i >= 0; i--)
    for (int j = m - 1; j >= 0; j--)
      if ((i + j) % 2 == 1) a[i][j] = ++k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      if (i > 0 &&
          ((a[i][j] - a[i - 1][j]) < 0 ? -(a[i][j] - a[i - 1][j])
                                       : (a[i][j] - a[i - 1][j])) < 2) {
        cout << "-1";
        goto l;
      } else if (i < n - 1 &&
                 ((a[i][j] - a[i + 1][j]) < 0 ? -(a[i][j] - a[i + 1][j])
                                              : (a[i][j] - a[i + 1][j])) < 2) {
        cout << "-1";
        goto l;
      } else if (j > 0 &&
                 ((a[i][j] - a[i][j - 1]) < 0 ? -(a[i][j] - a[i][j - 1])
                                              : (a[i][j] - a[i][j - 1])) < 2) {
        cout << "-1";
        goto l;
      } else if (j < m - 1 &&
                 ((a[i][j] - a[i][j + 1]) < 0 ? -(a[i][j] - a[i][j + 1])
                                              : (a[i][j] - a[i][j + 1])) < 2) {
        cout << "-1";
        goto l;
      }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << a[i][j] << " ";
    cout << endl;
  }
l:
  return 0;
}
