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 JAVA):

Solution:
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class C {
    public static void main(String[] args) throws Exception {
        FastScannerC fs = new FastScannerC();
        PrintWriter out = new PrintWriter(System.out);

        int n =fs.nextInt();
        int m =fs.nextInt();
        TreeSet<Integer> even = new TreeSet<>(), odd = new TreeSet<>();
        for(int i = 1; i <= n*m; i+=2) odd.add(i);
        for(int i = 2; i <= n*m; i+=2) even.add(i);
        int[][] res = new int[n][m];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                if(odd.isEmpty()) odd.addAll(even);
                res[i][j] = odd.pollLast();
            }
        }
        if(n == 2) {
            Arrays.sort(res[0]);
            shift(res[1]);
        }
        //for(int i =0; i < n; i++) System.out.println(Arrays.toString(res[i]));
        if(!check(res)) out.println(-1);
        else
            for(int i = 0; i < n; i++) {
                for(int j = 0; j < m-1; j++) out.print(res[i][j] + " ");
                out.println(res[i][m-1]);
            }

        out.close();
    }

    static void shift(int[] a) {
        Arrays.sort(a);
        int n = a.length;
        int last = a[0];
        for(int i = 0; i < n-1; i++) a[i] = a[i+1];
        a[n-1] = last;
    }

    static boolean check(int[][] res) {
        int n = res.length, m = res[0].length;
        for(int i= 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                int left = j-1 >= 0 ? res[i][j-1] : -100;
                int right = j+1 < m ? res[i][j+1] : -100;
                int up = i-1 >= 0 ? res[i-1][j] : -100;
                int down = i+1 < n ? res[i+1][j] : -100;
                int abs1 = Math.abs(left - res[i][j]);
                int abs2 = Math.abs(right - res[i][j]);
                int abs3 = Math.abs(down - res[i][j]);
                int abs4 = Math.abs(up - res[i][j]);
                //System.out.printf("%d %d %d %d\n", abs1, abs2, abs3, abs4);
                if(abs1 == 1 || abs2 == 1 || abs3 == 1 || abs4 == 1) return false;
            }
        }
        return true;
    }
}

class FastScannerC {
    BufferedReader br;
    StringTokenizer st;

    public FastScannerC() {
        try	{
            br = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer("");
        } catch (Exception e){e.printStackTrace();}
    }

    public String next() {
        if (st.hasMoreTokens())	return st.nextToken();
        try {st = new StringTokenizer(br.readLine());}
        catch (Exception e) {e.printStackTrace();}
        return st.nextToken();
    }

    public int nextInt() {return Integer.parseInt(next());}

    public long nextLong() {return Long.parseLong(next());}

    public double nextDouble() {return Double.parseDouble(next());}

    public String nextLine() {
        String line = "";
        try {line = br.readLine();}
        catch (Exception e) {e.printStackTrace();}
        return line;
    }

    public Integer[] nextIntegerArray(int n) {
        Integer[] a = new Integer[n];
        for(int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for(int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    public char[] nextCharArray() {
        return next().toCharArray();
    }
}