//
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int a[200][200];
int main()
{
int n,m;
cin >> n >> m;
int left = 0, right = m - 1, top = 0, bottom = n - 1;
int k = 1;
while(left <= right || top <= bottom)
{
for(int i = left; i <= right && top <= bottom; i ++)
{
a[top][i] = k ++;
}
top ++;
for(int i = top; i <= bottom && left <= right;i ++ )
{
a[i][right] = k ++;
}
right --;
for(int i = right; i >= left && top <= bottom; i -- )
{
a[bottom][i] = k ++;
}
bottom --;
for(int i = bottom; i >= top && left <= right; i --)
{
a[i][left] = k ++;
}
left ++;
}
for(int i = 0; i < n; i ++)
{
for(int j = 0; j < m; j ++)
{ cout << a[i][j] << ' ' ;}
cout << endl;
}
return 0;
}