#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[100][100],n,m,i,j;
cin >> n >> m;
//Construire
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
a[i][j] = min(i,j);
//Afisare
for(i=1;i<=n;i++){
for(j=1;j<=m;j++)
cout << a[i][j] << " ";
cout << endl;
}
}