#include <cstdio>
#include <vector>
#include <numeric>
#include <algorithm>
#include "sonlib.h"
bool explore0(int from, int to) {
if (MoveProbe(to) == 0) return false;
MoveProbe(from);
return true;
}
int n;
int p[401];
int get_other() {
std::iota(p, p+(n-1), 2);
int cnt = 0;
while (true) {
std::random_shuffle(p, p+(n-1));
for (int i = 0; i < n-1; i++) {
if (MoveProbe(p[i]) == 1)
return p[i];
}
MoveProbe(1);
cnt += n;
if (cnt > 900000)
return -1;
}
}
int main() {
n = GetN();
if (GetSubtask() != 1) {
printf("lubię placki\n");
return 0;
}
Examine();
int k = get_other();
//printf("k = %d\n", k);
if (k == -1) {
for (int i = 2; i <= n; i++) {
MoveProbe(i);
Examine();
MoveProbe(1);
}
}
else {
std::vector<int> white;
for (int i = 2; i <= n; i++) {
if (i == k) continue;
MoveProbe(i);
if (MoveProbe(1) == 1) {
white.push_back(i);
MoveProbe(i);
Examine();
MoveProbe(k);
}
}
MoveProbe(white[0]);
for (int i = 2; i <= n; i++) {
if (i == white[0]) continue;
if (MoveProbe(i) == 1) {
Examine();
MoveProbe(white[0]);
}
}
}
}