#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- int N,K; string P; set E[20220]; vector> build_prufer(vector V) { int N=V.size()+2; vector D; vector> E; int i,x,y; FOR(i,N) D.push_back(1); E.resize(N); FORR(v,V) D[v]++; set cand; FOR(i,N) if(D[i]==1) cand.insert(i); FORR(v,V) { x=*cand.begin(); cand.erase(x); E[v].push_back(x); E[x].push_back(v); D[v]--; D[x]--; if(D[v]==1) cand.insert(v); if(D[x]==1) cand.insert(x); } x=y=-1; FOR(i,N) if(D[i]==1) { if(x==-1) x=i; else y=i; } E[x].push_back(y); E[y].push_back(x); return E; } void solve() { int i,j,k,l,r,x,y; string s; cin>>P; if(P=="Alice") { cin>>N; cout<>x>>y; E[x-1].insert(y-1); E[y-1].insert(x-1); } FOR(i,N-2) { FOR(j,N) if(E[j].size()==1) break; x=*E[j].begin(); cout<>N; cout< V; FOR(i,N-2) { cin>>x; V.push_back(x-1); } auto E=build_prufer(V); FOR(i,N) FORR(e,E[i]) if(i