#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; void print(int pr[4]) { REP(i, 4) printf("%d%c", pr[i], i == 3 ? '\n' : ' '); fflush(stdout); } pii get() { pii res; scanf("%d %d", &res.first, &res.second); return res; } int main() { srand((unsigned int)time(NULL)); int ans[4], ng[4]; vector ord; REP(i, 10) ord.push_back(i); while (true) { REP(i, 100) swap(ord[rand() % 10], ord[rand() % 10]); REP(i, 4) ng[i] = ord[i]; print(ng); pii now = get(); if (now.first == 0 && now.second == 0) break; } REP(i, 4) ord.erase( find(ALL(ord), ng[i]) ); REP(i, 4) { int tmp = ng[i]; REP(j, ord.size()) { ng[i] = ord[j]; print(ng); pii now = get(); if (now.first == 1 && now.second == 0) break; } ans[i] = ng[i]; ng[i] = tmp; } print(ans); return 0; }