#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { int q = 10; vector v; while (q--){ int ans; string s = ""; for (int i = 0; i < 10; i++) s += to_string(q); cout << s << endl; cin >> ans >> s; for (int i = 0; i < ans; i++) v.push_back(q); } sort(v.begin(), v.end()); do{ int ans; string s; for (int i = 0; i < 10; i++) cout << v[i]; cout << endl; cin >> ans >> s; if (ans == 10) return 0; }while (next_permutation(v.begin(), v.end())); }