#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));
cout << sz(s) << " ";
vector<int> b;
for (auto j: s)b.push_back(j);
rep(j, 0, sz(b)) {
cout << b[j];
if (j < sz(b)-1)cout << " ";
}
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 ";
set<int> s;
rep(i, 1, n+1)s.insert(find(i));
int c = 1;
map<int, int> mp;
for (auto i: s)mp[i] = c++;
cout << "0 ";
rep(i, 1, n+1) {
cout << mp[find(i)];
if (i < n)cout << " ";
}
cout << endl;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}