#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,i,b=0;cin>>n>>k;
	deque<int> d;string ans(n+k,'1'),op;
	for (i=1;i<=n;i++) d.push_back(i);ans[0]='0';
	while (b<k-1+d.size())
	{
		cout<<d.front()<<' '<<ans.substr(0,k)<<endl<<flush;cin>>op;
		if (op=="yes"){while (ans[b]=='1'){b--;d.pop_back();}ans[b]='1';}
		else{ans[++b]='0';d.push_back(d.front());d.pop_front();}
	}
	cout<<0<<' '<<ans.substr(0,k)<<endl<<flush;
}

