#include #include using namespace std; #define rep(i,x) for(i=0;i<(x);++i) int n[4]; signed main() { ios::sync_with_stdio(false); cin.tie(0); rep(n[0], 10) { rep(n[1], n[0]) { rep(n[2], n[1]) { rep(n[3], n[2]) { cout << n[0] << ' ' << n[1] << ' ' << n[2] << ' ' << n[3] << endl; int x, y; cin >> x >> y; if (x + y == 4) goto end1; } } } } end1:; do { cout << n[0] << ' ' << n[1] << ' ' << n[2] << ' ' << n[3] << endl; int x, y; cin >> x >> y; if (x == 4) break; } while (next_permutation(n, n + 4)); }