#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) template inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } typedef long long ll; int const inf = 1<<29; int main() { // auto ask = [](int v[]) { rep(i, 4) printf("%d%c", v[i], i == 3 ? '\n' : ' '); }; auto get = []() { int hit, blow; scanf("%d%d",&hit,&blow); return std::move(make_pair(hit, blow)); }; int v[4], p = 0; rep(i, 10) { printf("%d %d %d %d\n", i, i, i, i); cout << flush; int hit, blow; scanf("%d%d",&hit,&blow); if(hit > 0) { v[p++] = i; } } do { printf("%d %d %d %d\n", v[0], v[1], v[2], v[3]); cout << flush; int hit, blow; scanf("%d%d",&hit,&blow); if(hit == 4) { exit(0); } } while(next_permutation(v, v+4)); return 0; }