#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) int main() { bool not_num[10] = {}; int use_num[4] = {}; int X,Y; while(true){ for(int i = 0;i < 10;i++){ if(not_num[i]) continue; for(int j = i + 1;j < 10;j++){ if(not_num[j]) continue; for(int k = j + 1;k < 10;k++){ if(not_num[k]) continue; for(int l = k + 1;l < 10;l++){ cout << i << " " << j << " " << k << " " << l << endl; cin >> X >> Y; if(X == 0 && Y == 0){ not_num[i] = true; not_num[j] = true; not_num[k] = true; not_num[l] = true; }else if(X + Y >= 2){ break; } if(X == 4) break; } if(X + Y >= 3) break; if(X == 4) break; } if(X + Y >= 4) break; if(X == 4) break; } if(X == 4) break; } if(X == 4) break; int how = 0; for(int i = 0;i < 10;i++){ if(not_num[i] == false){ use_num[how] = i; how++; } } for(int i = 0;i < 4;i++){ for(int j = 0;j < 4;j++){ if(i == j) continue; for(int k = 0;k < 4;k++){ if(k == i || k == j) continue; for(int l = 0;l < 4;l++){ if(l == i || l == j || l == k) continue; cout << use_num[i] << " " << use_num[j] << " " << use_num[k] << " " << use_num[l] << endl; cin >> X >> Y; if(X == 4) break; } if(X == 4) break; } if(X == 4) break; } if(X == 4) break; } break; } return 0; }