#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; int main(){ vi ans(4); ans[0] = 0, ans[1] = 1, ans[2] = 2, ans[3] = 3; int hit = -1, x, y; printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)return 0; hit = x + y; rep(i, 4){ rep(j, 10){ int uni = 1; rep(k, 4)if(i!=k && j == ans[k])uni = 0; if(uni){ int tmp = ans[i]; ans[i] = j; printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)return 0; if(x + y > hit){ hit = x + y; break; } else if(x + y < hit){ ans[i] = tmp; break; } } } } sort(all(ans)); do{ printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)break; } while(next_permutation(all(ans))); }