#include #include #include #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); vector a; for(int i = 0; i < 10; i++) { deque v; for(int j = 0; j < 10; j++) { if(i != j) v.push_back(j); } int sum = 0; for(int j = 0; j < 3; j++) { cout << i << " "; for(int k = 0; k < 3; k++) { cout << v.front() << " "; v.pop_front(); } cout << endl; cout.flush(); int x, y; cin >> x >> y; if(x == 4) return 0; sum += x + y; } if(sum == 6) { a.push_back(i); } } assert(a.size() == 4); bool used[4] = { 0 }; for(int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { for(int k = 0; k < 4; k++) { for(int l = 0; l < 4; l++) { int ans[4] = { a[i], a[j], a[k], a[l] }; bool flag = true; for(int m = 0; m < 4; m++) { for(int n = m + 1; n < 4; n++) { if(ans[n] == ans[m]) flag = false; } } if(flag) { for(int m = 0; m < 4; m++) { cout << ans[m] << " "; } cout << endl; cout.flush(); int x, y; cin >> x >> y; if(x == 4) return 0; } } } } } }