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 java.io.*;
import java.util.*;
public class Main {
    InputReader in;
    Helper_class h;
    final long mod=1000000007;
    public static void main(String[] args) throws java.lang.Exception {
        new Main().run();
    }
    void run() throws Exception {
        in=new InputReader(System.in);
        StringBuilder sb = new  StringBuilder(); 
        h = new Helper_class();       
        int t=1;
        for(int i=1;i<=t;i++)
            solve(sb);
        System.out.print(sb);
    }
    void solve(StringBuilder sb) {
        int i, j;
        int n=h.ni(), m=h.ni();
        if(n==1 && m==1) {
            sb.append("0\n");
            return;
        }
        if(m==1) {
            for(i=1;i<=n;i++)
                sb.append((i+1)+"\n");
            return;
        }
        int a[][]=new int[n+1][m+1];
        for(i=1;i<=n;i++) {
            for(j=1;j<=m;j++)
                a[i][j]=i*(j+n);
        }
        for(i=1;i<=n;i++) {
            for(j=1;j<=m;j++)
                sb.append(a[i][j]+" ");
            sb.append("\n");
        }
    }
    class Helper_class{
        long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
        int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
        String s(){return in.next();}
        int ni(){return Integer.parseInt(in.next());}
        long nl(){return Long.parseLong(in.next());}
        double d(){return Double.parseDouble(in.next());}
        long square(int x) {return ((long)x * (long)x);}
        long mul(long x, long y) {long ans = x*y;return (ans>=mod ? ans%mod : ans);}
        long power(long x, long y, long p) {  
            long res = 1;       
            x = x % p;  
            if (x == 0) return 0;   
            while (y > 0) {
                if((y & 1)==1) 
                    res = (res * x) % p;  
                y = y >> 1;  
                x = (x * x) % p;  
            } 
            return res%p; 
        } 
        void sorter(int a[]) {
            ArrayList<Integer> ar=new ArrayList<>();
            for(int i=0;i<a.length;i++)
                ar.add(a[i]);
            Collections.sort(ar);
            for(int i=0;i<ar.size();i++)
                a[i]=ar.get(i);
        }
        int lower(int a[], int k) {
            int l=0, r=a.length-1, ans=-1;
            while(l<=r) {
                int mid = (r+l)/2;
                if(a[mid]>k)
                    r=mid-1;
                else {
                    ans=mid;
                    l=mid+1;
                }
            }
            if(ans!=-1)
                ans=a[ans];
            return ans;
        }
        int upper(int a[], int k) {
            int l=0, r=a.length-1, ans=-1;
            while(l<=r) {
                int mid = (r+l)/2;
                if(a[mid]<k)
                    l=mid+1;
                else {
                    ans=mid;
                    r=mid-1;
                }
            }
            if(ans!=-1)
                ans=a[ans];
            return ans;
        }
        void reverse(int a[]) {
            for(int i=0;i<a.length/2;i++) {
                int x=a[i];
                a[i]=a[a.length-1-i];
                a[a.length-1-i]=x;
            }
        }
        //String.format("%.kf",x)
    }
    class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }
        public void skip(int x) {
            while (x-->0)
                read();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public String nextString() {
            return next();
        }
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
 
            return res.toString();
        }
        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }
        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}