#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  int a, b;
  cin >> a >> b;
  int arr[a][b];
  if (a == 1 && b == 1) {
    cout << "0";
    return 0;
  }
  int r = min(a, b);
  int c = max(a, b);
  if (r == a) {
    for (int i = 1; i <= r; i++) {
      for (int j = r + 1; j <= r + c; j++) {
        long long int an = ((long long int)(i * j)) / gcd(i, j);
        cout << an << " ";
        arr[i - 1][j - r - 1] = an;
      }
      cout << "\n";
    }
  } else {
    for (int j = r + 1; j <= r + c; j++) {
      for (int i = 1; i <= r; i++) {
        long long int an = ((long long int)(i * j)) / gcd(i, j);
        cout << an << " ";
        arr[j - r - 1][i - 1] = an;
      }
      cout << "\n";
    }
  }
}
