#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int x,y; cin>>x>>y; VV A(x); rep(i,x*y){ A[i%x].push_back(i+1); } V B,C; rep(i,x){ B.push_back(A[i][0]),C.push_back(A[(i+1)%x][0]); } rep(i,x) rep(j,y-1){ B.push_back(A[i][j]),C.push_back(A[i][j+1]); } cout<