//import java.util.*;
//public class Main{
// public static void main(String[] args) {
// Scanner t = new Scanner(System.in);
// int a = t.nextInt();
// int data[][]=new int[a][a];
// int c= 1;
// for(int i=0; i<a; i++) {
// for(int j=0; j<a; j++) {
// data[i][j]=c++;
// }
// }
// for(int i=0;i<a;i++) {
// for(int j=0;j<a;j++){
// System.out.print(data[i][j]+" ");
// }
// System.out.println();
// }
// }
//}
//import java.util.*;
//public class Main{
// public static void main(String[] args) {
// Scanner t = new Scanner(System.in);
// int a= t.nextInt();
// int data[][]= new int[a][a];
// int c= 1;
// for(int i=0; i<a; i++) {
// for(int j=0; j<a; j++) {
// data[i][j]=c++;
// }
// }
// for(int i=0;i<a;i++) {
// for(int j=0;j<a;j++) {
// System.out.print(data[j][i]+" "); // they switched the location of j and i so it's going to change the width and height of each array.
// }
// System.out.println();
// }
// }
//}
//import java.util.*;
//public class Main{
// public static void main(String[] args) {
// Scanner t = new Scanner(System.in);
// int a= t.nextInt();
// int data[][]= new int[a][a];
// int c= 1;
// for(int i=0; i<a; i++) {
// for(int j=0; j<a; j++) {
// data[i][j]=c++;
// }
// }
// for(int i=a-1; i>=0; i--) {
// for(int j=0;j<a;j++) {
// System.out.print(data[j][i]+" "); // they switched the location of j and i so it's going to change the width and height of each array.
// }
// System.out.println(); // this question is fucking annoying, it s crazy as f rn lkasjgnlkasdj glkasjd gkljasd
// }
// }
//}
//import java.util.*;
//public class Main{
// public static void main(String[] args) {
// Scanner t = new Scanner(System.in);
// int a = t.nextInt();
// int b = t.nextInt();
// int c = 1;
// int data[][]=new int[a][b];
// for (int i=0; i<a; i++) {
// for (int j=0; j<b; j++) {
// data[i][j]=c++;
// }
// }
// for (int i=a-1; i>=0; i--) {
// for(int j=b-1; j>=0; j--) {
// System.out.print(data[i][j]+" ");
// }
// System.out.println();
// }
// }
//}
//import java.util.*;
//public class Main{
// public static void main(String[] args) {
// Scanner t = new Scanner(System.in);
// int a = t.nextInt();
// int b = t.nextInt();
// int c =1;
// int data[][] = new int [a][b];
// for (int i=0; i<a; i++) {
// for(int j=0; j<b; j++) {
// data[i][j]=c++;
// }
// }
// for(int i=a-1; i>=0; i--) {
// for(int j=0; j<b; j++) {
// System.out.print(data[i][j]+" ");
// }
// System.out.println();
// }
//
// }
//}
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner t = new Scanner(System.in);
int a= t.nextInt();
int b = t.nextInt();
int c = 1;
int data[][]=new int [a][b];
for(int i=0; i<a; i++) {
for (int j=0; j<b; j++) {
data[i][j]=c++;
}
}
for (int i=a-1; i>=0; i--) {
for (int j=0; j<b; j-=2) {
System.out.print(data[i][j]+" ");
}
System.out.println();
}
}
}