1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#include <bits/stdc++.h>
using namespace std;
vector<int>seedA={1,4,5,0,4,3,4,1,5,2,2,1,3,4,4,4,4,3,0,1,5,5,4,4,1,0,0,5,3,1,4,3,4,3,3,2,4,5,2,4,1,4,5,4,0,3,1,4,5,1,0,4,5,2,2,4,2,1,2,4,2,0,1,0,1,4,1,0,3,3,4,3,5,1,5,0,3,0,4,2,0,2,0,3,2,1,1,5,2,1,1,2,1,0,1,3,4,0,3,5,3,5,0,2,4,4,0,1,4,5,1,2,5,0,5,2,1,5,5,1,0,0,1,0,0,2,1,2,2,2,5,3,5,4,4,3,2,4,3,0,1,4,1,1,2,4,1,1,3,0,2,2,4,2,0,2,4,1,2,5,1,5,2,0,3,4,1,5,3,4,4,4,1,5,5,3,3,4,5,5,4,5,5,0,1,5,2,4,4,2,3,5,2,3,3,5,2,4,3,5,1,1,1,2,4,5,3,5,3,2,4,2,0,1,0,1,0,3,3,2,5,0,5,5,2,2,5,4,5,0,1,0,5,2,0,3,1,3,2,3,4,5,3,4,0,3,3,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1,4,5,2,2,2,3,3,4,0,3,3,4,1,3,3,2,1,5,2,3,4,2,3,1,1,3,4};
vector<vector<char>>tab={{'P','K','N'},{'P','N','K'},{'K','P','N'},{'N','P','K'},{'K','N','P'},{'N','K','P'}};
struct bigint
{
	vector<uint32_t>v;
	void zerw()
	{
		while(!v.empty()&&v[v.size()-1]==0)
			v.pop_back();
	}
	void add(uint32_t x)
	{
		uint64_t car=x;
		int i=0;
		while(car)
		{
			if(i==v.size())
				v.push_back(0);
			uint64_t sm=car+v[i];
			v[i]=(uint32_t)sm;
			car=sm>>32;
			i++;
		}
	}
	void mul(uint32_t x)
	{
		if(x==0)
		{
			v.clear();
			return;
		}
		uint64_t car=0;
		for(int i=0; i<v.size(); i++)
		{
			uint64_t sm=car+(uint64_t)v[i]*x;
			v[i]=(uint32_t)sm;
			car=sm>>32;
		}
		if(car)
			v.push_back((uint32_t)car);
	}
	uint32_t div(uint32_t x)
	{
		uint64_t car=0;
		for(int i=v.size()-1; i>=0; i--)
		{
			uint64_t sm=(car<<32)|v[i];
			v[i]=(uint32_t)(sm/x);
			car=sm%x;
		}
		zerw();
		return (uint32_t)car;
	}
	bigint(string s)
	{
		for(auto i:s)
		{
			mul(2);
			if(i=='1')
				add(1);
		}
		zerw();
	}
	bigint(vector<int>v1)
	{
		for(int i:v1)
		{
			mul(3);
			add(i);
		}
		zerw();
	}
	string bin()
	{
		if(v.empty())
			return "0";
		string res="";
		while(!v.empty())
		{
			auto i=div(2);
			res+=char('0'+i);
		}
		reverse(res.begin(),res.end());
		return res;
	}
	vector<int> tren()
	{
		if(v.empty())
			return {0};
		vector<int>res;
		while(!v.empty())
		{
			auto i=div(3);
			res.push_back(i);
		}
		reverse(res.begin(),res.end());
		return res;
	}
};
vector<int> conv23(string s)
{
	bigint x(s);
	return x.tren();
}
string conv32(vector<int> v)
{
	bigint x(v);
	return x.bin();
}
int gra(char moje, char opa)
{
	if(moje==opa)
		return 0;
	if((moje=='K'&&opa=='N')||(moje=='N'&&opa=='P')||(moje=='P'&&opa=='K'))
		return 1;
	return -1;
}
int zn(int i, char odp)
{
	for(int j=0; j<3; j++)
		if(tab[seedB[i]][j]==odp)
			return j;
}
int n;
int dl=3155;
void solve()
{
	string code;
	cin>>code;
	vector<int>code3=conv23(code);
	int i=0;
	vector<int>res;
	int stan=0;
	for(int j=0; j<dl-code3.size(); j++)
	{
		char moje=tab[seedA[i]][0];
		char opa;
		cout<<moje<<"\n";
		cin>>opa;
		res.push_back(zn(i,opa));
		stan+=gra(moje,opa);
		if(stan==1)
		{
			cout<<"P\n";
			cin>>opa;
			stan=0;
		}
		if(stan==-1)
		{
			cout<<"N\n";
			cin>>opa;
			stan=0;
		}
		i++;
	}
	int i1=0;
	while(i1<code3.size())
	{
		char moje=tab[seedA[i]][code3[i1]];
		char opa;
		cout<<moje<<"\n";
		cin>>opa;
		res.push_back(zn(i,opa));
		stan+=gra(moje,opa);
		if(stan==1)
		{
			cout<<"P\n";
			cin>>opa;
			stan=0;
		}
		if(stan==-1)
		{
			cout<<"N\n";
			cin>>opa;
			stan=0;
		}
		i++;
		i1++;
	}
	cout<<"! ";
	string ress=conv32(res);
	for(int j=0; j<n-ress.length(); j++)
		cout<<'0';
	cout<<ress<<"\n";
	cout.flush();
}
int main()
{
	string s;
	cin>>s;
	int t;
	cin>>n>>t;
	if(s=="Bajtek")
		swap(seedA,seedB);
	while(t--)
		solve();
	
}