#include <stdio.h>
int main()
{
int a[102][102]={};
int i,j,n,m,x=1,y=1,s=0,c=1;
scanf("%d %d",&n,&m);
for(i = 0; i<=n+1; i++){
a[i][0]=-1;
a[i][m+1]=-1;
}
for( j=0; j<=m+1; j++){
a[0][j]=-1;
a[n+1][j]=-1;
}
for(int k=1; k<=n*m; k++){
a[x][y]=k;
if(a[x-1][y+1] != -1){
x--;
y++;
}
else if(a[x-1][y+1] ==-1){
s++;
if(s<n){
x=s+1;
y=1;
}
else{
c++;
x=n;
y=c;
}
}
}
for(i=1; i<=n; i++){
for(j=1; j<=m; j++){
printf("%d ",a[i][j]);
//printf("%2d(%2d,%2d) ",a[i][j],i,j);
}
printf("\n");
}
return 0;
}