#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
#include<unordered_set>
using namespace std;
string ans = "0000000000";
int main() {
	string t;
	for (int i = 0;i < 10;i++) {
		map<int, int> mp;
		for (int j = 0;j < 10;j++) {
			ans[i] = '0' + j;
			cout << ans << endl;
			int a;
			string b;
			cin >> a >> b;
			if (b == "unlocked") {
				return 0;
			}
			mp[a]++;
		}
		int anss = mp.begin()->first;
		auto it = mp.begin();
		it++;
		if (mp.begin()->second > (it)->second) {
			anss = (it)->first;
		}
		for (int j = 0;j < 10;j++) {
			ans[i] = '0' + j;
			cout << ans << endl;
			int a;
			string b;
			cin >> a >> b;
			if (b == "unlocked") {
				return 0;
			}
			if (a == anss) {
				break;
			}
		}
	}
	return 0;
}