#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(x,s,e) for (auto x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e)?x++:x--))
#define sz(x) (int)x.size()
const char nl = '\n';
const int N = 150+10;
int a[N];
int find(int x) {
if (a[x] == x)return x;
return a[x] = find(a[x]);
}
void unite(int x, int y) {
x = find(x), y = find(y);
a[x] = y;
}
void solve() {
int n; cin >> n;
rep(i, 1, n+1)a[i] = i;
//2 1 2 3 1
for (int i = n-1; i >= 1; --i) {
int l = i, r = n+1;
while (r-l>1) {
int mid = l+r>>1;
set<int> s;
rep(j, i, mid+1)
s.insert(find(j));
//if (i == 4 && mid == 5) {
//cout << find(5) << " " <<mid << endl;
//}
cout << sz(s) << " ";
for (auto j: s)cout << j << " ";
cout << endl;
int x; cin >> x;
if (x != mid-i+1)r = mid;
else l = mid;
}
if (r == n+1)continue;
unite(i, r);
}
cout << "0 ";
rep(i, 1, n+1)cout << find(i) << " ";
cout << endl;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}