#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; #define all(c) (c).begin(), (c).end() #define rep(i,n) for(int i=0;i<(int)(n);i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second const ll INF=1e9; const ll MOD=1e9+7; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; vector ans; pair query(vector vec) { rep(i,4) cout< ret; cin>>ret.first>>ret.second; return ret; } int main() { ans.resize(4); vector vec; vec.resize(4); rep(i,4) { auto p=query(ans); rep(j,10) { vec[i]=j; auto t=query(ans); if(t.second>=p.second) ans=vec; } } sort(all(ans)); do { query(ans); }while(std::next_permutation(all(ans))); return 0; }