#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int h = (n+1)/2; int k = n % 2 == 0 ? 2 : 1; cout << k << " " << h << endl; if(n % 2 == 0) h++; while(true){ int t; cin >> t; if(t == 0) exit(0); int l, y; cin >> l >> y; cout << l << " " << (y > h ? y - h : y + h) << endl; } }