Problem: Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n × m squares and decided to plant a forest there. Vasya will plant nm trees of all different heights from 1 to nm. For his forest to look more natural he wants any two trees growing in the side neighbouring squares to have the absolute value of difference in heights to be strictly more than 1. Help Vasya: make the plan of the forest planting for which this condition is fulfilled.

Input

The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 100) — the number of rows and columns on Vasya's field

Output

If there's no solution, print -1. Otherwise, print n lines containing m numbers each — the trees' planting plan. In every square of the plan the height of a tree that should be planted on this square should be written. If there are several solutions to that problem, print any of them.

Examples

Input

2 3


Output

3 6 2
5 1 4


Input

2 1


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n, m;
bool okk(int x, int y, int a, int b) {
  return (x >= 0 && y >= 0 && x < a && y < b);
}
bool ok(vector<int> A, int a, int b) {
  int B[100][100];
  for (int i = 0; i < A.size(); i++) B[i / b][i % b] = A[i];
  bool res = true;
  int dx[] = {0, 0, 1, -1};
  int dy[] = {1, -1, 0, 0};
  for (int i = 0; i < a; i++)
    for (int j = 0; j < b; j++) {
      for (int k = 0; k < 4; k++) {
        int tx = i + dx[k], ty = j + dy[k];
        if (okk(tx, ty, a, b) && abs(B[i][j] - B[tx][ty]) <= 1) res = false;
      }
    }
  return res;
}
vector<int> solve(int a, int b) {
  int l = 0, r = a * b - 1;
  vector<int> R;
  for (int i = 0; i < a * b; i++) {
    if (i % 2 == 0) {
      R.push_back(l);
      l++;
    } else {
      R.push_back(r);
      r--;
    }
  }
  if (a == 1 && b > 1) {
    swap(R.back(), R[0]);
    if (ok(R, a, b) == false) {
      swap(R.back(), R[0]);
      swap(R[R.size() - 2], R[0]);
    }
    return R;
  }
}
int main() {
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n <= 2 && m <= 2) {
    cout << -1 << endl;
    return 0;
  }
  if (n > 3 && m > 3) {
    vector<int> P;
    P = solve(1, n);
    vector<vector<int> > R(n);
    for (int i = 0; i < n; i++) {
      vector<int> T;
      T = solve(1, m);
      for (int j = 0; j < T.size(); j++) T[j] += i * m;
      R[P[i]] = T;
    }
    vector<int> V;
    for (int i = 0; i < R.size(); i++)
      for (int j = 0; j < R[i].size(); j++) V.push_back(R[i][j]);
    for (int i = 0; i < R.size(); i++) {
      for (int j = 0; j < R[i].size(); j++) cout << R[i][j] + 1 << ' ';
      cout << endl;
    }
  } else {
    bool bb = false;
    if (n > m) {
      bb = true;
      swap(n, m);
    }
    if (n == 1) {
      vector<int> T;
      T = solve(1, m);
      if (ok(T, 1, m) == false)
        cout << -1 << endl;
      else {
        for (int i = 0; i < T.size(); i++) {
          cout << T[i] + 1;
          if (bb)
            cout << endl;
          else
            cout << ' ';
        }
        cout << endl;
      }
    } else if (n == 2) {
      if (bb == false) {
        for (int i = 0; i < m; i++) {
          if (i % 2 == 0)
            cout << i + m + 1 << ' ';
          else
            cout << i + 1 << ' ';
        }
        cout << endl;
        for (int i = m; i < 2 * m; i++) {
          if ((m - i) % 2 == 0)
            cout << i - m + 1 << ' ';
          else
            cout << i + 1 << ' ';
        }
      } else {
        for (int i = 0; i < m; i++) {
          if (i % 2 == 0)
            cout << i + 1 << ' ' << i + m + 1 << endl;
          else
            cout << m + i + 1 << ' ' << i + 1 << endl;
        }
      }
    } else if (n == 3) {
      int R[100][100];
      for (int i = 0; i < 3; i++)
        for (int j = 0; j < m; j++) R[i][j] = i * m + j;
      for (int i = 0; i < m; i++)
        if (i % 2 == 1) swap(R[0][i], R[1][i]);
      for (int i = 0; i < m; i++)
        if (i % 2 == 1) swap(R[1][i], R[2][i]);
      if (bb == false) {
        for (int i = 0; i < n; i++) {
          for (int j = 0; j < m; j++) cout << R[i][j] + 1 << ' ';
          cout << endl;
        }
      } else {
        for (int i = 0; i < m; i++) {
          for (int j = 0; j < n; j++) cout << R[j][i] + 1 << ' ';
          cout << endl;
        }
      }
    }
  }
  cin >> n;
  return 0;
}