Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int N,A,B;
int ret[2020];

int ask(int a,int b) {
	char buf[1010];
	_P("? %d %d\n",a,b);
	fflush(stdout);
	scanf("%s",buf);
	return buf[0]=='Y';
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	scanf("%d%d",&A,&B);
	if(A<=B) {
		_P("Impossible\n");
		return;
	}
	
	N=A+B;
	vector<int> path;
	FOR(i,N) {
		if(path.empty() || ask(path.back(),i))
			path.push_back(i);
		}
		else {
			path.pop_back();
		}
		if(path.size()>B) break;
	}
	
	x = path.back();
	FOR(i,N) ret[i]=ask(x,i);
	_P("!");
	FOR(i,N) _P("%d",ret[i]);
	_P("\n");
	
	
	
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:42:17: error: 'else' without a previous 'if'
   42 |                 else {
      |                 ^~~~
a.cc:45:35: error: break statement not within loop or switch
   45 |                 if(path.size()>B) break;
      |                                   ^~~~~
a.cc: At global scope:
a.cc:48:9: error: 'x' does not name a type
   48 |         x = path.back();
      |         ^
a.cc:7:19: error: expected unqualified-id before 'for'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                   ^~~
a.cc:49:9: note: in expansion of macro 'FOR'
   49 |         FOR(i,N) ret[i]=ask(x,i);
      |         ^~~
a.cc:49:13: error: 'i' does not name a type
   49 |         FOR(i,N) ret[i]=ask(x,i);
      |             ^
a.cc:7:27: note: in definition of macro 'FOR'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                           ^
a.cc:49:13: error: 'i' does not name a type
   49 |         FOR(i,N) ret[i]=ask(x,i);
      |             ^
a.cc:7:34: note: in definition of macro 'FOR'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                                  ^
a.cc:6:18: error: expected unqualified-id before 'void'
    6 | #define _P(...) (void)printf(__VA_ARGS__)
      |                  ^~~~
a.cc:50:9: note: in expansion of macro '_P'
   50 |         _P("!");
      |         ^~
a.cc:6:18: error: expected ')' before 'void'
    6 | #define _P(...) (void)printf(__VA_ARGS__)
      |                 ~^~~~
a.cc:50:9: note: in expansion of macro '_P'
   50 |         _P("!");
      |         ^~
a.cc:7:19: error: expected unqualified-id before 'for'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                   ^~~
a.cc:51:9: note: in expansion of macro 'FOR'
   51 |         FOR(i,N) _P("%d",ret[i]);
      |         ^~~
a.cc:51:13: error: 'i' does not name a type
   51 |         FOR(i,N) _P("%d",ret[i]);
      |             ^
a.cc:7:27: note: in definition of macro 'FOR'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                           ^
a.cc:51:13: error: 'i' does not name a type
   51 |         FOR(i,N) _P("%d",ret[i]);
      |             ^
a.cc:7:34: note: in definition of macro 'FOR'
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                                  ^
a.cc:6:18: error: expected unqualified-id before 'void'
    6 | #define _P(...) (void)printf(__VA_ARGS__)
      |                  ^~~~
a.cc:52:9: note: in expansion of macro '_P'
   52 |         _P("\n");
      |         ^~
a.cc:6:18: error: expected ')' before 'void'
    6 | #define _P(...) (void)printf(__VA_ARGS__)
      |                 ~^~~~
a.cc:52:9: note: in expansion of macro '_P'
   52 |         _P("\n");
      |         ^~
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^