#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
typedef unsigned int uint;
typedef unsigned long ulong;

int main() {
	int count = 0;
	int number[10] = { 0 };
	int answer = 0;
	int targetmask = 1;
	int responce1 = 0;
	string responce2;
	int lastnumber = 0;

	while(true) {
		printf("%010d\n", answer);
		cin >> responce1 >> responce2;
		if (responce2 == "unlocked") {
			return 0;
		}
		else {
			if (responce1 != lastnumber) {
				targetmask *= 10;
				lastnumber = responce1;
			}
			else {
				// :(
			}
			answer += targetmask;
		}
	}

	return 0;
}