#include using namespace std; using ll = long long; template using vc = vector; template using vv = vc>; using vl = vc; using vs = vc; #define rep(i,n) for(ll i=1;i<(n);i++) #define pb push_back #define pob pop_back #define YES cout<<"Yes"<> x >> y; cout << x*y << " " << x*y << endl; rep(i,x){ cout << i << " " << i+1 << endl; ll bef=i,aft=i+x; rep(j,y){ cout << bef << " " << aft << endl; bef=aft; aft+=x; } } cout << x << " " << 1 << endl; ll bef=x,aft=x+x; rep(j,y){ cout << bef << " " << aft << endl; bef=aft; aft+=x; } }