#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int p = 1e9 ,pp = 4e5;
map<pair<int,int>,bool> vis ;
int random(int n){
return 1ll * rand() * rand() % n ;
}
int main(){
ios::sync_with_stdio(false);
srand((unsigned)time(0));
int n = random(p) + 1 ,m = random(p) + 1;
int k = min(100ll,1ll * n * m - 1) ;
cout << n << ' ' << m << ' ' << k << endl;
for(int i = 1 ,x ,y;i <= k;i ++ ){
x = random(n) + 1,y = random(m) + 1;
while(vis[{x,y}]){
x = random(n) ,y = random(m) ;
}
vis[{x,y}] = true ;
cout << x << ' ' << y << endl;
}
return 0;
}