#include<iostream> using namespace std; int main(){ int n, m; cin >> n >> m; for(int j = 1; j <= n * m; j ++ ){ if(j % m == 0) cout << "PUM"<<endl; else cout << j << " "; } return 0; }