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.util.*;
import static java.math.BigInteger.*;
import java.math.BigInteger;
public class Main{

	int h;
	int w;
	int[][]b;
	void solve()throws Exception
	{
		h=nextInt();
		w=nextInt();
		boolean rot=false;
		if(h>w)
		{
			int t=h;
			h=w;
			w=t;
			rot=true;
		}
		b=new int[h][w];
		
		boolean ok=false;
		if(w<=3)
		{
			ok=dfs(0,new boolean[h*w]);
		
		}
		else
		{
			ok=true;
			for(int i=0;i<w/2;i++)
			{
				b[0][i]=2*(i+1);
			}
			int num=1;
			for(int i=w/2;i<w;i++)
			{
				b[0][i]=num;
				num+=2;
			}
			for(int r=1;r<h;r++)
				for(int c=0;c<w;c++)
					b[r][c]=b[r-1][c]+w;
			if(!check())
				throw new RuntimeException();
		}
		if(rot)
		{
			int[][]z=new int[w][h];
			for(int r=0;r<h;r++)
				for(int c=0;c<w;c++)
					z[c][r]=b[r][c];
			b=z;
			int t=h;
			h=w;
			w=t;
		}
		if(!ok)
			System.out.println(-1);
		else
			for(int r=0;r<h;r++)
				for(int c=0;c<w;c++)
				{
					if(c==b[0].length-1)
						System.out.println(b[r][c]);
					else
						System.out.print(b[r][c]+" ");
				}
	
	}	
	boolean dfs(int at,boolean[]used)
	{
		if(at==h*w)
			return check();
		for(int x=1;x<=h*w;x++)
			if(!used[x-1])
			{
				used[x-1]=true;
				b[at/w][at%w]=x;
				if(dfs(at+1,used))
					return true;
				used[x-1]=false;
			}
		return false;
	}
	private boolean check() {
		for(int r=0;r<h;r++)
			for(int c=0;c<w;c++)
			{
				if(r>0 && Math.abs(b[r-1][c]-b[r][c])==1)
					return false;
				if(c>0 && Math.abs(b[r][c-1]-b[r][c])==1)
					return false;
				if(r<h-1 && Math.abs(b[r+1][c]-b[r][c])==1)
					return false;
				if(c<w-1 && Math.abs(b[r][c+1]-b[r][c])==1)
					return false;
			}
		return true;
	}
	BufferedReader reader;
	PrintWriter writer;
	StringTokenizer stk;
	void run()throws Exception
	{
		reader=new BufferedReader(new InputStreamReader(System.in));
		stk=null;
		writer=new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}
	int nextInt()throws Exception
	{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws Exception
	{	
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws Exception
	{		
		return Double.parseDouble(nextToken());
	}
	String nextString()throws Exception
	{
		return nextToken();
	}
	String nextLine()throws Exception
	{
		return reader.readLine();
	}
	String nextToken()throws Exception
	{
		if(stk==null || !stk.hasMoreTokens())
		{
			stk=new StringTokenizer(nextLine());
			return nextToken();
		}
		return stk.nextToken();
	}
	
	public static void main(String[]a) throws Exception
	{	
		new Main().run();

	}
	
}