Problem: Let a be a matrix of size r × c containing positive integers, not necessarily distinct. Rows of the matrix are numbered from 1 to r, columns are numbered from 1 to c. We can construct an array b consisting of r + c integers as follows: for each i ∈ [1, r], let b_i be the greatest common divisor of integers in the i-th row, and for each j ∈ [1, c] let b_{r+j} be the greatest common divisor of integers in the j-th column. 

We call the matrix diverse if all r + c numbers b_k (k ∈ [1, r + c]) are pairwise distinct. 

The magnitude of a matrix equals to the maximum of b_k.

For example, suppose we have the following matrix:

\begin{pmatrix} 2 & 9 & 7\\\ 4 & 144 & 84 \end{pmatrix} 

We construct the array b:

  1. b_1 is the greatest common divisor of 2, 9, and 7, that is 1; 
  2. b_2 is the greatest common divisor of 4, 144, and 84, that is 4; 
  3. b_3 is the greatest common divisor of 2 and 4, that is 2; 
  4. b_4 is the greatest common divisor of 9 and 144, that is 9; 
  5. b_5 is the greatest common divisor of 7 and 84, that is 7. 



So b = [1, 4, 2, 9, 7]. All values in this array are distinct, so the matrix is diverse. The magnitude is equal to 9.

For a given r and c, find a diverse matrix that minimises the magnitude. If there are multiple solutions, you may output any of them. If there are no solutions, output a single integer 0. 

Input

The only line in the input contains two space separated integers r and c (1 ≤ r,c ≤ 500) — the number of rows and the number of columns of the matrix to be found.

Output

If there is no solution, output a single integer 0.

Otherwise, output r rows. The i-th of them should contain c space-separated integers, the j-th of which is a_{i,j} — the positive integer in the i-th row and j-th column of a diverse matrix minimizing the magnitude.

Furthermore, it must hold that 1 ≤ a_{i,j} ≤ 10^9. It can be shown that if a solution exists, there is also a solution with this additional constraint (still having minimum possible magnitude).

Examples

Input


2 2


Output


4 12
2 9

Input


1 1


Output


0

Note

In the first example, the GCDs of rows are b_1 = 4 and b_2 = 1, and the GCDs of columns are b_3 = 2 and b_4 = 3. All GCDs are pairwise distinct and the maximum of them is 4. Since the GCDs have to be distinct and at least 1, it is clear that there are no diverse matrices of size 2 × 2 with magnitude smaller than 4.

In the second example, no matter what a_{1,1} is, b_1 = b_2 will always hold, so there are no diverse matrices.

Solution (in JAVA):

Solution:
import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.IllegalCharsetNameException;
import java.sql.SQLOutput;
import java.util.*;



public class Main {
    static int[] arr;
    static boolean[] v;
    static long n;
    static int[] parity;
    static long k;
    static long ans  = Long.MIN_VALUE;
    static TreeSet<Long> set = new TreeSet<>();
    static HashMap<Long,Long> map = new HashMap<>();


    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int t = 1;
        while (t-->0){
            solve();
        }
    }

    static void rec(long N , int cnt){
        if (N==0){
            return;
        }
        if (set.contains(N)){
            return;
        }
        set.add(N);
        if (N%2==0){
            cnt+=helper(N+1);
            cnt+=helper(2*N);
        }
        else{
            cnt+=helper(2*N);
        }
        //System.out.println(N + " " + cnt);
        if (cnt>=k) {
            ans = Math.max(ans , N);
        }
        if (N%2==0){
            rec(N/2 , cnt+1);
        }
        else{
            rec(N-1 , cnt + 1);
        }
    }

    static long helper(long N){
        //System.out.println(N);
        if (map.containsKey(N)){
            return map.get(N);
        }
        if (set.contains(N)){
            return 0;
        }
        if (N>n){
            return 0;
        }
        if (N%2==0){
            long cnt = 1 + helper(N+1) + helper(2*N);
            map.put(N,cnt);
            if (cnt>=k){
                ans = Math.max(N , ans);
            }
            return cnt;
        }
        else{
            long cnt = 1 + helper(2*N);
            map.put(N,cnt);
            if (cnt>=k){
                ans = Math.max(N , ans);
            }
            return cnt;
        }
    }







    /*static int find(int x) {
        return parent[x] == x ? x : (parent[x] = find(parent[x]));
    }
    static void merge(int x, int y) {
        x = find(x);
        y = find(y);
        if ( x > y ){
            parent[y] = x;
        }
        else if (y > x){
            parent[x] = y;
        }
    }*/

    static Deque<Integer>[] graph ;

    static void solve()throws IOException{
        int r = Reader.nextInt();
        int c = Reader.nextInt();
        int f = 0;
        if (r < c){
            f = 1;
        }
        if ( r > c){
            int tmp = r;
            r = c;
            c = tmp;
        }
        if (r==1 && c==1){
            System.out.println(0);
            return;
        }
        int[][] arr = new int[r][c];
        int cnt = 1;
        for (int i = 0 ; i < r ; i++){
            for (int j  = 0 ; j < c ; j++){
                arr[i][j] = cnt;
            }
            cnt++;
        }
        cnt = r+1;
        for (int i = 0 ; i < c ; i++){
            for (int j = 0 ; j < r; j++){
                arr[j][i] *= cnt;
            }
            cnt++;
        }
        if (f==1) {
            for (int i = 0; i < r; i++) {
                for (int j = 0; j < c; j++) {
                    System.out.print(arr[i][j] + " ");
                }
                System.out.println();
            }
        }
        else{
            for (int i = 0; i < c; i++) {
                for (int j = 0; j < r; j++) {
                    System.out.print(arr[j][i] + " ");
                }
                System.out.println();
            }
        }

    }

    static int dfs(int start , int cannot){
        if (start==cannot){
            return 0;
        }
        v[start] = true;
        Iterator i = graph[start].iterator();
        int cnt = 1;
        while (i.hasNext()){
            int next = (int)i.next();
            if (!v[next]){
                cnt+=dfs(next,cannot);
            }
        }
        return cnt;
    }


    public static void sortbyColumn(int arr[][], int col)
    {
        // Using built-in sort function Arrays.sort
        Arrays.sort(arr, new Comparator<int[]>() {

            @Override
            // Compare values according to columns
            public int compare(final int[] entry1,
                               final int[] entry2) {

                // To sort in descending order revert
                // the '>' Operator
                if (entry1[col] > entry2[col])
                    return 1;
                else
                    return -1;
            }
        });  // End of function call sort().
    }


    static class Node{
        long a;
        int i;
        Node(long a, int i){
            this.a = a;
            this.i = i;
        }
    }

}


class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class MergeSort
{
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];


        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

    /* A utility function to print array of size n */
    static void printArray(int arr[])
    {
        int n = arr.length;
        for (int i=0; i<n; ++i)
            System.out.print(arr[i] + " ");
        System.out.println();
    }

    // Driver method

}

class Node implements Comparable<Node>{
    int a;
    int b;
    Node (int a , int b){
        this.a = a;
        this.b = b;
    }



    public int compareTo(Node o) {
        if ((this.a%2) == (o.a%2)){
            return (this.b - o.b);
        }
        else{
            return this.a - o.a;
        }
    }
}