#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; int ans = 0; for (int i = 0; (1 << i) <= n; i++) { int m = (1 << (i + 1)); vector r; for (int j = 0; j < m; j++) { if (j & (1 << i)) { r.push_back(j); } } cout << m << " " << r.size() << endl; for (int x : r) { cout << x << " "; } cout << endl; int c; cin >> c; ans += (1 << i) * c; } cout << "0 1" << endl; cout << ans << endl; }