#include <bits/stdc++.h>
using namespace std;
int n,m;
int q[11000][3];
int a[110][110];
int i,j,head=1,tail=1;
int fx[5] = {0,0,1,0,-1};
int fy[5] = {0,1,0,-1,0};
int main(){
cin>>n>>m;
q[head][1] = 1;
q[head][2] = 1;
int tx,ty;
a[1][1] = 1;
int k = 2;
while(head <= tail){
for(i = 1;i <= 4;i++){
tx = q[head][1] + fx[i];
ty = q[head][2] + fy[i];
if(tx >= 1 && tx <= n && ty >= 1 && ty <= m && a[tx][ty] == 0){
tail++;
q[tail][1] = tx;
q[tail][2] = ty;
a[tx][ty] = k;
k++;
}
}
head++;
}
for(i = 1;i <= n;i++){
for(j = 1;j <= m;j++){
cout<<a[i][j];
if(j != m){
cout<<" ";
}
}
cout<<endl;
}
return 0;
}
/**************************************************************
Problem: 1751
User: admin
Language: C++
Result: Accepted
Time:25 ms
Memory:2248 kb
****************************************************************/