#include #include #include int main() { std::vector num; std::vector count(10); int x, y; for(int p=0; p<=3; ++p){ for(int i=0; i<=6; ++i){ switch(p){ case 0: std::cout << "1 2 3 "; break; case 1: std::cout << "0 2 3 "; break; case 2: std::cout << "0 1 3 "; break; case 3: std::cout << "0 1 2 "; break; } std::cout << p+i << std::endl; std::cin >> x >> y; if(x==4) return 0; count[p+i]=x+y; if(count[p] < count[p+i]){ num.push_back(i); }else if(count[p] > count[p+i]){ num.push_back(p); } if(num.size()==4) break; } if(num.size()==4) break; } do{ for(int i=0; i<4; ++i){ std::cout << num[i] << " "; } std::cout << std::endl; std::cin >> x >> y; if(x==4) return 0; }while(std::next_permutation(num.begin(), num.end())); return 0; }