/*
	problem : CF1466I The Riddle of the Sphinx
	reference : https://www.luogu.com.cn/blog/CXY07/solution-cf1466i
*/
#include <bits/stdc++.h>
#define mp std::make_pair
#define pb push_back
#define fi first
#define se second
#define gc getchar
#define pc putchar
#define ep emplace
#define eb emplace_back
#define ctz __builtin_ctz
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef std::pair <int, int> pii;
typedef std::pair <int, ll> pil;
typedef std::pair <ll, int> pli;
typedef std::pair <ll, ll> pll;
const int max_N = 207;
int n, b;
std::string ans;
int read() {
	char c = gc(); int ans = 0; bool flag = true;
	while (!isdigit(c)) flag &= (c != '-'), c = gc();
	while (isdigit(c)) ans = ans * 10 + c - '0', c = gc();
	return flag ? ans : -ans;
}
void Write(int x) {
	if (x < 0) pc('-'), x = -x;
	if (x < 10) pc(x + '0');
	else Write(x / 10), pc(x % 10 + '0');
}
int min(int x, int y) {return x < y ? x : y;}
int max(int x, int y) {return x > y ? x : y;}
void _min(int &x, int y) {if (x > y) x = y;}
void _max(int &x, int y) {if (x < y) x = y;}
namespace Interactive {
	bool compare(int x, std::string y) {
		std::cout << x << ' ' << y << std::endl;
		return std::cin >> y, y == "yes";
	}
	bool compare_less(int x, std::string y) {
		if (!std::count(y.begin(), y.end(), '1')) return false;
		for (int pos = y.size() - 1; y[pos] == '0' ? (y[pos] = '1', true) : (y[pos] = '0', false); pos--); 
		return y.insert(y.end(), b - y.size(), '1'), !compare(x, y);
	}
	bool compare_greater(int x, std::string y) {
		if (!std::count(y.begin(), y.end(), '0')) return false;
		return y.insert(y.end(), b - y.size(), '1'), compare(x, y);
	}
	void report(std::string x) {
		std::cout << 0 << ' ' << x << std::endl;
	}
}
void solve(std::vector <int> vec, int w) {
	std::vector <int> stack;
	for (auto i : vec) {
		while (!stack.empty() && Interactive::compare_greater(i,
			(std::string) {ans.begin(), ans.begin() + w + stack.size()})) stack.pop_back();
		if (w + stack.size() < b)
			ans[w + stack.size()] = !Interactive::compare_less(i,
				(std::string) {ans.begin(), ans.begin() + w + stack.size()} + '1') + '0', stack.pb(i);
	}
	for (int i = stack.size() - 1; i >= 0; i--)
		if (Interactive::compare_greater(stack[i],
			(std::string) {ans.begin(), ans.begin() + w + stack.size()})) stack.resize(i + 1);
	if (w + stack.size() < b) solve(stack, w + stack.size());
}
int main() {
	std::cin >> n >> b;
	std::vector <int> vec; vec.resize(n);
	std::iota(vec.begin(), vec.end(), 1);
	ans.resize(b); solve(vec, 0);
	return Interactive::report(ans), 0;
}
