#include<iostream>
using namespace std;
int main()
{
//freopen("xxx.in","r",stdin);
//freopen("yyy.out","w",stdout);
int k=1;
int n,m;
cin >> m >> n;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(j==n-1)
cout << "PUM";
else
cout << k << " ";
k++;
}
cout << endl;
}
//fclose(stdin);
//(stdout);
return 0;
}