#include typedef long long ll; const int MAXN = 2e5 + 5; using namespace std; int a[5], N, res, tmp; int main() { ios::sync_with_stdio(false); cin >> N; for (int i = 0; i <= 4; ++i) { cout << 5 << " " << 1 << endl; cout << i << endl; cin >> a[i]; } for (int i = 1; i <= N, a[1] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[1] -= tmp; } for (int i = 2; i <= N, a[2] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[2] -= tmp; } for (int i = 3; i <= N, a[3] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[3] -= tmp; } for (int i = 4; i <= N, a[4] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[4] -= tmp; } for (int i = 5; i <= N, a[0] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[0] -= tmp; } cout << 0 << " " << 1 << endl; cout << res << endl; return 0; }