#include <iostream>
using namespace std;
int main(){
int row,column,k=0;
cin >> row >> column;
int **p = new int* [row];
for(int i = 0; i < row; i++)
p[i] = new int[column];
for(int i = 0; i < row; i++)
for(int j = 0; j < column; j++)
p[i][j] = ++k;
for(int i = 0; i < row; i++){
for(int j = 0; j < column; j++)
cout << p[i][j] << " ";
cout << endl;
}
for(int i = 0; i < row; i++)
delete []p[i];
p = NULL;
return 0;
}