import java.util.Scanner;

public class Section049 {
	public static void main(String[] args) {
		Scanner scanf = new Scanner(System.in);
		int row, col, i, j, L, m;
		row = scanf.nextInt();
		col = scanf.nextInt();
		int a[][] = new int[row][col];
		int b[][] = new int[col][row];
		int k = 0;
		for (i = 0; i <= row - 1; i++)
		{
			for (j = 0; j <= col - 1; j++)
			{
				k++;
				a[i][j] = k;
			}
		}
		L = 0;
		m = -1;
		for (i = 0; i <= row - 1; i++)
		{
			for (j = 0; j <= col - 1; j++)
			{
				m += 1;
				b[L][m] = a[i][j];
				if (m >= row - 1)
				{
					L++;
					m = -1;
				}
			}
		}
		for (int x = 0; x < col; x++)
		{
			for (int y = 0; y < row; y++)
				System.out.printf("%3d", b[x][y]);
			System.out.printf("\n");
		}
		scanf.close();
	}
}
