// Problem : E2. Bitwise Queries (Hard Version)
// Contest : Codeforces - Codeforces Round #685 (Div. 2)
// URL : https://codeforces.com/contest/1451/problem/E2
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//HAR HAR MAHADEV
//WHEN IT GETS HARDER REMEMBER WHY YOU STARTED💪
/*ヽ｀、ヽ｀｀、ヽ｀ヽ｀、、ヽ ｀ヽ 、ヽ｀🌙｀ヽヽ｀ヽ、ヽ｀
ヽ｀、ヽ｀｀、ヽ 、｀｀、 ｀、ヽ｀ 、｀ ヽ｀ヽ、ヽ ｀、ヽ｀｀、
ヽ、｀｀、｀、ヽ｀｀、 、ヽヽ｀、｀、、ヽヽ、｀｀、 、 ヽ｀、
ヽ｀｀、 ヽ｀ヽ｀、、ヽ ｀ヽ 、 🚶ヽ｀｀｀｀ヽヽヽ｀、、ヽ｀、、ヽ*/
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long   ll;
typedef long double ld;
typedef complex< ld > cd;

typedef pair<int, int> pi;
typedef pair<ll, ll>   pl;
typedef pair<ld, ld>   pd;

typedef vector< int > vi;
typedef vector< ld >  vd;
typedef vector< ll >  vl;
typedef vector< pi >  vpi;
typedef vector< pl >  vpl;
typedef vector< cd >  vcd;

#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a)    for (int i=0; i<(a); i++)
#define rep1(i, a, b) for (int i = (b)-1; i >= a; i--)
#define rep(i, a)     for (int i = (a)-1; i >= 0; i--)
#define trav(a, x)    for (auto& a : x)
#define uid(a, b)     uniform_int_distribution<int>(a, b)(rng)
#define vt vector
#define bug(x) cout<<#x<<"="<<x<<endl;

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f  first
#define s  second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ins insert
//#define MOD 998244353

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> using PR = pair<T, T>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ld pii = 3.14159265359;
const int MOD = 1000000007;
const char cl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vi a(n + 1);
    map<int, int> xors;
    bool flag = false;
    int ind1, ind2;
    a[1] = 0;
    xors[0] = 1;
    l00p(i, 2, n + 1) {
        cout << "XOR 1 " << i << endl;
        cin >> a[i];
        if (xors.count(a[i])) {
            debug(a[i]);
            flag = true;
            ind1 = xors[a[i]];
            ind2 = i;
        }
        xors[a[i]] = i;
    }
    vi ans(n + 1);
    if (flag) {
        cout << "AND " << ind1 << " " << ind2 << endl;
        cin >> ans[ind1];
        l00p(i, 1, n + 1) {
            ans[i] = (ans[ind1] ^ a[i]);
        }
        cout << "! ";
        l00p(i, 1, n + 1) {
            cout << ans[i] << " ";
        }
    }
    else {
        int var2, var3;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                break;
            }
        }
        l00p(i, 2, n + 1) {
            if (a[i] != n - 1) {
                var3 = i;
                break;
            }
        }
        int x, y, z=a[var2];
        cout << "AND 1 " << var3 << endl;
        int tt1;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        int tt2;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        cout << "! ";
        l00p(i, 1, n + 1) {
            cout << ans[i] << " ";
        }
    }
    return 0;
}
/* stuff you should look for
    * jab answer dhoondhna ho to matlb binary search beta
    * int overflow, array bounds
    * special cases (n=1?)
    * do smth instead of nothing and stay organized
    * WRITE STUFF DOWN
    * DON'T GET STUCK ON ONE APPROACH
*/


// Problem : E2. Bitwise Queries (Hard Version)
// Contest : Codeforces - Codeforces Round #685 (Div. 2)
// URL : https://codeforces.com/contest/1451/problem/E2
// Memory Limit : 256 MB
// Time Limit : 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//HAR HAR MAHADEV
//WHEN IT GETS HARDER REMEMBER WHY YOU STARTED💪
/*ヽ｀、ヽ｀｀、ヽ｀ヽ｀、、ヽ ｀ヽ 、ヽ｀🌙｀ヽヽ｀ヽ、ヽ｀
ヽ｀、ヽ｀｀、ヽ 、｀｀、 ｀、ヽ｀ 、｀ ヽ｀ヽ、ヽ ｀、ヽ｀｀、
ヽ、｀｀、｀、ヽ｀｀、 、ヽヽ｀、｀、、ヽヽ、｀｀、 、 ヽ｀、
ヽ｀｀、 ヽ｀ヽ｀、、ヽ ｀ヽ 、 🚶ヽ｀｀｀｀ヽヽヽ｀、、ヽ｀、、ヽ*/
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long   ll;
typedef long double ld;
typedef complex< ld > cd;

typedef pair<int, int> pi;
typedef pair<ll, ll>   pl;
typedef pair<ld, ld>   pd;

typedef vector< int > vi;
typedef vector< ld >  vd;
typedef vector< ll >  vl;
typedef vector< pi >  vpi;
typedef vector< pl >  vpl;
typedef vector< cd >  vcd;

#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a)    for (int i=0; i<(a); i++)
#define rep1(i, a, b) for (int i = (b)-1; i >= a; i--)
#define rep(i, a)     for (int i = (a)-1; i >= 0; i--)
#define trav(a, x)    for (auto& a : x)
#define uid(a, b)     uniform_int_distribution<int>(a, b)(rng)
#define vt vector
#define bug(x) cout<<#x<<"="<<x<<endl;

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f  first
#define s  second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ins insert
//#define MOD 998244353

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> using PR = pair<T, T>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ld pii = 3.14159265359;
const int MOD = 1000000007;
const char cl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vi a(n + 1);
    map<int, int> xors;
    bool flag = false;
    int ind1, ind2;
    a[1] = 0;
    xors[0] = 1;
    l00p(i, 2, n + 1) {
        cout << "XOR 1 " << i << endl;
        cin >> a[i];
        if (xors.count(a[i]) && !flag) {
            debug(a[i]);
            flag = true;
            ind1 = xors[a[i]];
            ind2 = i;
        }
        xors[a[i]] = i;
    }
    vi ans(n + 1);
    if (flag) {
        cout << "AND " << ind1 << " " << ind2 << endl;
        cin >> ans[ind1];
        ans[1] = (ans[ind1] ^ a[1])
        l00p(i, 1, n + 1) {
            ans[i] = (ans[1] ^ a[i]);
        }
        cout << "! ";
        l00p(i, 1, n + 1) {
            cout << ans[i] << " ";
        }
    }
    else {
        int var2, var3;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                break;
            }
        }
        l00p(i, 2, n + 1) {
            if (a[i] != n - 1) {
                var3 = i;
                break;
            }
        }
        int x, y, z=a[var2];
        cout << "AND 1 " << var3 << endl;
        int tt1;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        int tt2;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        cout << "! ";
        l00p(i, 1, n + 1) {
            cout << ans[i] << " ";
        }
    }
    return 0;
}
/* stuff you should look for
    * jab answer dhoondhna ho to matlb binary search beta
    * int overflow, array bounds
    * special cases (n=1?)
    * do smth instead of nothing and stay organized
    * WRITE STUFF DOWN
    * DON'T GET STUCK ON ONE APPROACH
*/


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<cmath>
#include<vector>
#include<cstring>
#include<set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define LL __int128
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define PI acos(-1)
#define ull unsigned long long
const int maxn = 1e6 + 9;
const int MOD = 1000000007;
int mod = 999998639;
ll exgcd(ll a,ll b,ll &x,ll &y){if(b==0) {x=1,y=0;return a;}ll d=exgcd(b,a%b,x,y);ll z=x;x=y,y=z-y*(a/b);return d;}
inline ll qpow(ll b, ll e, ll m = MOD) { ll a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
//inline void print(__int128 x){if (x < 0){putchar('-');x = -x;}if (x > 9)print(x / 10);putchar(x % 10 + '0');}
//LL exgcd(LL a,LL b,LL &x,LL &y){if(b==0) {x=1,y=0;return a;}LL d=exgcd(b,a%b,x,y);LL z=x;x=y,y=z-y*(a/b);return d;}
//inline LL qpow(LL b, LL e, LL m = MOD) { LL a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
vector<int> ve[maxn];
int ans[maxn];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int id=0;
		for(int i=2;i<=n;i++)
		{
			printf("XOR 1 %d\n",i);
			fflush(stdout);
			scanf("%d",&ans[i]);
			ve[ans[i]].push_back(i);
			if(ans[i]==n-1) id=i;
		}
		bool flag=false;
		for(int i=0;i<=n;i++)
		{
			if(ve[i].size()>=2)
			{
				flag=true;
				int x=ve[i][0],y=ve[i][1];
				printf("AND %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&ans[x]);
				ans[1]=ans[y]^ans[x];
				ans[y]=ans[x];
				for(int j=2;j<=n;j++)
				{
					if(j==x||j==y) continue;
					ans[i]^=ans[1];
				}
				break;
			}
		}
		if(!flag)
		{
			int k=2;
			while(k==id) k++;
			printf("AND %d %d\n",id,k);
			fflush(stdout);
			int jk;
			scanf("%d",&jk);
			jk*=2;
			printf("AND 1 %d\n",k);
			fflush(stdout);
			int ik;
			scanf("%d",&ik);
			ik*=2;
			int x=n-1,y=((n-1)^ans[k])+jk,z=ans[k]+ik;
			ans[1]=(x-y+z)/2;
			for(int i=2;i<=n;i++)
			{
				ans[i]^=ans[1];
			}
		}
		printf("! ");
		for(int i=1;i<=n;i++)
		{
			printf("%d ",ans[i]);
		}
		printf("\n");
		fflush(stdout);
	}
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<cmath>
#include<vector>
#include<cstring>
#include<set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define LL __int128
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define PI acos(-1)
#define ull unsigned long long
const int maxn = 1e6 + 9;
const int MOD = 1000000007;
int mod = 999998639;
ll exgcd(ll a,ll b,ll &x,ll &y){if(b==0) {x=1,y=0;return a;}ll d=exgcd(b,a%b,x,y);ll z=x;x=y,y=z-y*(a/b);return d;}
inline ll qpow(ll b, ll e, ll m = MOD) { ll a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
//inline void print(__int128 x){if (x < 0){putchar('-');x = -x;}if (x > 9)print(x / 10);putchar(x % 10 + '0');}
//LL exgcd(LL a,LL b,LL &x,LL &y){if(b==0) {x=1,y=0;return a;}LL d=exgcd(b,a%b,x,y);LL z=x;x=y,y=z-y*(a/b);return d;}
//inline LL qpow(LL b, LL e, LL m = MOD) { LL a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
vector<int> ve[maxn];
int ans[maxn];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int id=0;
		for(int i=2;i<=n;i++)
		{
			printf("XOR 1 %d\n",i);
			fflush(stdout);
			scanf("%d",&ans[i]);
			ve[ans[i]].push_back(i);
			if(ans[i]==n-1) id=i;
		}
		bool flag=false;
		for(int i=0;i<=n;i++)
		{
			if(ve[i].size()>=2)
			{
				flag=true;
				int x=ve[i][0],y=ve[i][1];
				printf("AND %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&ans[x]);
				ans[1]=ans[y]^ans[x];
				ans[y]=ans[x];
				for(int j=2;j<=n;j++)
				{
					if(j==x||j==y) continue;
					ans[j]^=ans[1];
				}
				break;
			}
		}
		if(!flag)
		{
			int k=2;
			while(k==id) k++;
			printf("AND %d %d\n",id,k);
			fflush(stdout);
			int jk;
			scanf("%d",&jk);
			jk*=2;
			printf("AND 1 %d\n",k);
			fflush(stdout);
			int ik;
			scanf("%d",&ik);
			ik*=2;
			int x=n-1,y=((n-1)^ans[k])+jk,z=ans[k]+ik;
			ans[1]=(x-y+z)/2;
			for(int i=2;i<=n;i++)
			{
				ans[i]^=ans[1];
			}
		}
		printf("! ");
		for(int i=1;i<=n;i++)
		{
			printf("%d ",ans[i]);
		}
		printf("\n");
		fflush(stdout);
	}
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<cmath>
#include<vector>
#include<cstring>
#include<set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define LL __int128
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define PI acos(-1)
#define ull unsigned long long
const int maxn = 1e6 + 9;
const int MOD = 1000000007;
int mod = 999998639;
ll exgcd(ll a,ll b,ll &x,ll &y){if(b==0) {x=1,y=0;return a;}ll d=exgcd(b,a%b,x,y);ll z=x;x=y,y=z-y*(a/b);return d;}
inline ll qpow(ll b, ll e, ll m = MOD) { ll a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
//inline void print(__int128 x){if (x < 0){putchar('-');x = -x;}if (x > 9)print(x / 10);putchar(x % 10 + '0');}
//LL exgcd(LL a,LL b,LL &x,LL &y){if(b==0) {x=1,y=0;return a;}LL d=exgcd(b,a%b,x,y);LL z=x;x=y,y=z-y*(a/b);return d;}
//inline LL qpow(LL b, LL e, LL m = MOD) { LL a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
vector<int> ve[maxn];
int ans[maxn];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int id=0;
		for(int i=2;i<=n;i++)
		{
			printf("XOR 1 %d\n",i);
			fflush(stdout);
			scanf("%d",&ans[i]);
			ve[ans[i]].push_back(i);
			if(ans[i]==n-1) id=i;
		}
		bool flag=false;
		for(int i=0;i<=n;i++)
		{
			if(ve[i].size()>=2)
			{
				flag=true;
				int x=ve[i][0],y=ve[i][1];
				printf("AND %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&ans[x]);
				ans[1]=ans[y]^ans[x];
				ans[y]=ans[x];
				for(int j=2;j<=n;j++)
				{
					if(j==x||j==y) continue;
					ans[i]^=ans[1];
				}
			}
		}
		if(!flag)
		{
			int k=2;
			while(k==id) k++;
			printf("AND %d %d\n",id,k);
			fflush(stdout);
			int jk;
			scanf("%d",&jk);
			jk*=2;
			printf("AND 1 %d\n",k);
			fflush(stdout);
			int ik;
			scanf("%d",&ik);
			ik*=2;
			int x=n-1,y=((n-1)^ans[k])+jk,z=ans[k]+ik;
			ans[1]=(x-y+z)/2;
			for(int i=2;i<=n;i++)
			{
				ans[i]^=ans[1];
			}
		}
		printf("! ");
		for(int i=1;i<=n;i++)
		{
			printf("%d ",ans[i]);
		}
		printf("\n");
		fflush(stdout);
	}
}


#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<cmath>
#include<vector>
#include<cstring>
#include<set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define LL __int128
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define PI acos(-1)
#define ull unsigned long long
const int maxn = 1e6 + 9;
const int MOD = 1000000007;
int mod = 999998639;
ll exgcd(ll a,ll b,ll &x,ll &y){if(b==0) {x=1,y=0;return a;}ll d=exgcd(b,a%b,x,y);ll z=x;x=y,y=z-y*(a/b);return d;}
inline ll qpow(ll b, ll e, ll m = MOD) { ll a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
//inline void print(__int128 x){if (x < 0){putchar('-');x = -x;}if (x > 9)print(x / 10);putchar(x % 10 + '0');}
//LL exgcd(LL a,LL b,LL &x,LL &y){if(b==0) {x=1,y=0;return a;}LL d=exgcd(b,a%b,x,y);LL z=x;x=y,y=z-y*(a/b);return d;}
//inline LL qpow(LL b, LL e, LL m = MOD) { LL a = 1; for (; e; e >>= 1, b = b * b % m)if (e & 1)a = a * b % m; return a; }
vector<int> ve[maxn];
int ans[maxn];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int id=0;
		for(int i=2;i<=n;i++)
		{
			printf("XOR 1 %d\n",i);
			fflush(stdout);
			scanf("%d",&ans[i]);
			ve[ans[i]].push_back(i);
			if(ans[i]==n-1) id=i;
		}
		bool flag=false;
		for(int i=1;i<=n;i++)
		{
			if(ve[i].size()>=2)
			{
				flag=true;
				int x=ve[x][0],y=ve[x][1];
				printf("AND %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&ans[x]);
				ans[1]=ans[y]^ans[x];
				ans[y]=ans[x];
				for(int j=2;j<=n;j++)
				{
					if(j==x||j==y) continue;
					ans[i]^=ans[1];
				}
			}
		}
		if(!flag)
		{
			int k=2;
			while(k==id) k++;
			printf("AND %d %d\n",id,k);
			fflush(stdout);
			int jk;
			scanf("%d",&jk);
			jk*=2;
			printf("AND 1 %d\n",k);
			fflush(stdout);
			int ik;
			scanf("%d",&ik);
			ik*=2;
			int x=n-1,y=((n-1)^ans[k])+jk,z=ans[k]+ik;
			ans[1]=(x-y+z)/2;
			for(int i=2;i<=n;i++)
			{
				ans[i]^=ans[1];
			}
		}
		printf("! ");
		for(int i=1;i<=n;i++)
		{
			printf("%d ",ans[i]);
		}
		printf("\n");
		fflush(stdout);
	}
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
	int N, A[1<<17];
	cin>>N;
	map<int,vector<int>> mp;
	int sa = -1;
	for(int i=2; i<=N; i++){
		cout<<"XOR 1 "<<i<<endl;
		int a;
		cin>>a; A[i] = a;
		mp[a].push_back(i);
		if(mp[a].size() > 1){
			sa = a;
		}
	}

	if(sa >= 0){
		int i = mp[sa][0], j = mp[sa][1];
		cout<<"AND "<<i<<" "<<j<<endl;
		int a;
		cin>>a;
		A[1] = A[i] ^ a;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}else{
		int b = A[2], c = A[2];
		for(int i=0; (1<<i) < N; i++){
			c ^= (1<<i);
		}
		int i = 2, j = mp[c][0];
		cout<<"AND 1 "<<i<<endl;
		cin>>b;
		cout<<"AND 1 "<<j<<endl;
		cin>>c;
		A[1] = b | c;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}

	}

	cout<<"! ";
	for(int i=1; i<=N; i++){
		cout<<A[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
	int N, A[1<<17];
	cin>>N;
	map<int,vector<int>> mp;
	int sa = -1;
	for(int i=2; i<=N; i++){
		cout<<"XOR 1 "<<i<<endl;
		int a;
		cin>>a; A[i] = a;
		mp[a].push_back(i);
		if(mp[a].size() > 1){
			sa = a;
		}
	}

	if(sa > 0){
		int i = mp[sa][0], j = mp[sa][1];
		cout<<"AND "<<i<<" "<<j<<endl;
		int a;
		cin>>a;
		A[1] = A[i] ^ a;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}else{
		A[1] = 0;
	}

	cout<<"! ";
	for(int i=1; i<=N; i++){
		cout<<A[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
	int N, A[1<<17];
	cin>>N;
	map<int,vector<int>> mp;
	int sa = -1;
	for(int i=2; i<=N; i++){
		cout<<"XOR 1 "<<i<<endl;
		int a;
		cin>>a; A[i] = a;
		mp[a].push_back(i);
		if(mp[a].size() > 1){
			sa = a;
		}
	}

	if(sa >= 0){
		int i = mp[sa][0], j = mp[sa][1];
		cout<<"AND "<<i<<" "<<j<<endl;
		int a;
		cin>>a;
		A[1] = A[i] ^ a;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}else{
		int b = A[2], c = A[2];
		for(int i=0; (1<<i) < N; i++){
			c ^= (1<<i);
		}
		int i = 2;
		int j = 0;
		if(mp.find(c) != mp.end()) j = mp[c][0];
		else{
			i = 3; b = A[i]; c = A[3];
			for(int i=0; (1<<i) < N; i++){
				c ^= (1<<i);
			}
			j = mp[c][0];
		}
		cout<<"AND 1 "<<i<<endl;
		cin>>b;
		cout<<"AND 1 "<<j<<endl;
		cin>>c;
		A[1] = b | c;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}

	}

	cout<<"! ";
	for(int i=1; i<=N; i++){
		cout<<A[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
	int N, A[1<<17];
	cin>>N;
	map<int,vector<int>> mp;
	int sa = -1;
	for(int i=2; i<=N; i++){
		cout<<"XOR 1 "<<i<<endl;
		int a;
		cin>>a; A[i] = a;
		mp[a].push_back(i);
		if(mp[a].size() > 1){
			sa = a;
		}
	}

	if(sa >= 0){
		int i = mp[sa][0], j = mp[sa][1];
		cout<<"AND "<<i<<" "<<j<<endl;
		int a;
		cin>>a;
		A[1] = A[i] ^ a;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}else{
		A[1] = 0;
	}

	cout<<"! ";
	for(int i=1; i<=N; i++){
		cout<<A[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){
	int N, A[1<<17];
	cin>>N;
	map<int,vector<int>> mp;
	int sa = -1;
	for(int i=2; i<=N; i++){
		cout<<"XOR 1 "<<i<<endl;
		int a;
		cin>>a; A[i] = a;
		mp[a].push_back(i);
		if(mp[a].size() > 1){
			sa = a;
		}
	}

	if(sa >= 0){
		int i = mp[sa][0], j = mp[sa][1];
		cout<<"AND "<<i<<" "<<j<<endl;
		int a;
		cin>>a;
		A[1] = A[i] ^ a;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}else{
		int b = A[2], c = A[2];
		for(int i=0; (1<<i) < N; i++){
			c ^= (1<<i);
		}
		int i = 2, j = mp[c][0];
		cout<<"AND 1 "<<i<<endl;
		cin>>b;
		cout<<"AND 1 "<<j<<endl;
		cin>>c;
		A[1] = b & c;
		for(int i=2; i<=N; i++){
			A[i] ^= A[1];
		}
	}

	cout<<"! ";
	for(int i=1; i<=N; i++){
		cout<<A[i]<<" ";
	}
	cout<<endl;

	return 0;
}


#include <bits/stdc++.h>
#define fore(it,a)       for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define forr(i, a, b)    for(int i = (a); i <= (b); ++i)
#define ford(i, a, b)    for(int i = (a); i >= (b); --i)
#define repp(i, a, b)    for(int i = (a); i < (b); ++i)
#define repd(i, a, b)    for(int i = (a); i > (b); --i)
#define mem(a, x)        memset(x, (a), sizeof(x))
#define bitcount(x)      __builtin_popcountll((x))
#define OFFBIT(mask, i)  ((mask) &~ (1ll << (i)))
#define ONBIT(mask, i)   ((mask) | (1ll << (i)))
#define reset(x)         memset(x, 0, sizeof(x))
#define all(a)           (a).begin(), (a).end()
#define BIT(x, i)        (((x) >> (i)) & 1)
#define ii               pair<int, int>
#define MASK(i)          (1LL << (i))
#define mp               make_pair
#define se               second
#define fi               first

using namespace std;
mt19937_64 random_num(chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD  = 1000000007;
const int inf  = 2000000000;
const int mod  = 1007050321;
const double e = 0.000001;
const int N    = 300005;
const bool aut = 788480;
const int base = 521;

int n, a[N], x[N], cnt[N];
vector<int> pos;

void Write() {
    cout << "! " << a[1] << " ";
    forr(i, 2, n)
    cout << (x[i] ^ a[1]) << " ";
}

int main() {
    ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

    cin >> n;
    int dem;
    ford(i, 30, 0)
    if(BIT(n, i) == 1) {
        dem = i+1;
        break;
    }
    bool ok = false;
    forr(i, 2, n) {
        cout << "XOR 1 " << i << "\n";
        cout.flush();
        cin >> x[i];
        if(x[i] == 0 && !ok) {
            cout << "OR 1 " << i << "\n";
            cout.flush();
            cin >> a[1];
            ok = true;
        }
        pos.push_back(i);
    }
    if(ok) {
        Write();
        return 0;
    }
    sort(all(pos), [&](int i, int j) {
        return x[i] < x[j];
    });
    repp(i, 1, pos.size())
    if(x[pos[i]] == x[pos[i-1]]) {
        cout << "OR " << pos[i] << " " << pos[i-1] << "\n";
        cout.flush();
        cin >> a[pos[i]];
        a[1] = x[pos[i]] ^ a[pos[i]];
        Write();
        return 0;
    }
    forr(i, 2, n) {
        if(cnt[x[i]^(n-1)]) {
            cout << "OR 1 " << i << "\n";
            int d1, d2;
            cout.flush();
            cin >> d1;
            cout << "OR 1 " << cnt[x[i]^(n-1)] << "\n";
            cout.flush();
            cin >> d2;
            repp(j, 0, dem) {
                if(BIT(d1, j) == 0)
                    continue;
                if(BIT(d2, j) == 1)
                    a[1] |= MASK(j);
            }
            break;
        } else
            cnt[x[i]] = i;
    }
    Write();

    return 0;
}


#include <bits/stdc++.h>
#define fore(it,a)       for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define forr(i, a, b)    for(int i = (a); i <= (b); ++i)
#define ford(i, a, b)    for(int i = (a); i >= (b); --i)
#define repp(i, a, b)    for(int i = (a); i < (b); ++i)
#define repd(i, a, b)    for(int i = (a); i > (b); --i)
#define mem(a, x)        memset(x, (a), sizeof(x))
#define bitcount(x)      __builtin_popcountll((x))
#define OFFBIT(mask, i)  ((mask) &~ (1ll << (i)))
#define ONBIT(mask, i)   ((mask) | (1ll << (i)))
#define reset(x)         memset(x, 0, sizeof(x))
#define all(a)           (a).begin(), (a).end()
#define BIT(x, i)        (((x) >> (i)) & 1)
#define ii               pair<int, int>
#define MASK(i)          (1LL << (i))
#define mp               make_pair
#define se               second
#define fi               first

using namespace std;
mt19937_64 random_num(chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD  = 1000000007;
const int inf  = 2000000000;
const int mod  = 1007050321;
const double e = 0.000001;
const int N    = 300005;
const bool aut = 788480;
const int base = 521;

int n, a[N], x[N], cnt[N];
vector<int> pos;

void Write() {
	cout << "! " << a[1] << " ";
	forr(i, 2, n)
		cout << (x[i] ^ a[1]) << " ";
}

int main() {
	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

	cin >> n;
	int dem = bitcount(n);
	bool ok = false;
	forr(i, 2, n) {
		cout << "XOR 1 " << i << "\n";
		cout.flush();
		cin >> x[i];
		if(x[i] == 0 && !ok) {
			cout << "OR  1" << i << "\n";
			cout.flush();
			cin >> a[1];
			ok = true;
		}
		pos.push_back(i);
	}
	if(ok) {
		Write();
		return 0;
	}
	sort(all(pos), [&](int i, int j){
		return x[i] < x[j];
	});
	repp(i, 1, pos.size())
		if(x[pos[i]] == x[pos[i-1]]) {
			cout << "OR " << pos[i] << " " << pos[i-1] << "\n";
			cout.flush();
			cin >> a[pos[i]];
			a[1] = x[pos[i]] ^ a[pos[i]];
			Write();
			return 0;
		}
	repp(i, 1, pos.size())
		if(x[pos[i]] != x[pos[i-1]] + 1)
				ok = true;
	if(!ok) {
		Write();
		return 0;
	}
	forr(i, 2, n) {
		if(cnt[x[i]^(n-1)]) {
			cout << "OR 1 i\n";
			int d1, d2;
			cout.flush();
			cin >> d1;
			cout << "OR 1 " << cnt[x[i]] << "\n";
			cout.flush();
			cin >> d2;
			repp(j, 0, dem) {
				if(BIT(d1, i) == 0) continue;
				if(BIT(d2, i) == 1)
					a[1] |= MASK(i);
			}
			break;
		} else cnt[x[i]] = i;
	}
	Write();

	return 0;
}


#include <bits/stdc++.h>
#define fore(it,a)       for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define forr(i, a, b)    for(int i = (a); i <= (b); ++i)
#define ford(i, a, b)    for(int i = (a); i >= (b); --i)
#define repp(i, a, b)    for(int i = (a); i < (b); ++i)
#define repd(i, a, b)    for(int i = (a); i > (b); --i)
#define mem(a, x)        memset(x, (a), sizeof(x))
#define bitcount(x)      __builtin_popcountll((x))
#define OFFBIT(mask, i)  ((mask) &~ (1ll << (i)))
#define ONBIT(mask, i)   ((mask) | (1ll << (i)))
#define reset(x)         memset(x, 0, sizeof(x))
#define all(a)           (a).begin(), (a).end()
#define BIT(x, i)        (((x) >> (i)) & 1)
#define ii               pair<int, int>
#define MASK(i)          (1LL << (i))
#define mp               make_pair
#define se               second
#define fi               first

using namespace std;
mt19937_64 random_num(chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD  = 1000000007;
const int inf  = 2000000000;
const int mod  = 1007050321;
const double e = 0.000001;
const int N    = 300005;
const bool aut = 788480;
const int base = 521;

int n, a[N], x[N], cnt[N];
vector<int> pos;

void Write() {
    cout << "! " << a[1] << " ";
    forr(i, 2, n)
    cout << (x[i] ^ a[1]) << " ";
}

int main() {
    ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

    cin >> n;
    int dem = bitcount(n);
    bool ok = false;
    forr(i, 2, n) {
        cout << "XOR 1 " << i << "\n";
        cout.flush();
        cin >> x[i];
        if(x[i] == 0 && !ok) {
            cout << "OR 1 " << i << "\n";
            cout.flush();
            cin >> a[1];
            ok = true;
        }
        pos.push_back(i);
    }
    if(ok) {
        Write();
        return 0;
    }
    sort(all(pos), [&](int i, int j) {
        return x[i] < x[j];
    });
    repp(i, 1, pos.size())
    if(x[pos[i]] == x[pos[i-1]]) {
        cout << "OR " << pos[i] << " " << pos[i-1] << "\n";
        cout.flush();
        cin >> a[pos[i]];
        a[1] = x[pos[i]] ^ a[pos[i]];
        Write();
        return 0;
    }
    repp(i, 1, pos.size())
    if(x[pos[i]] != x[pos[i-1]] + 1)
        ok = true;
    if(!ok) {
        Write();
        return 0;
    }
    forr(i, 2, n) {
        if(cnt[x[i]^(n-1)]) {
            cout << "OR 1 i\n";
            int d1, d2;
            cout.flush();
            cin >> d1;
            cout << "OR 1 " << cnt[x[i]] << "\n";
            cout.flush();
            cin >> d2;
            repp(j, 0, dem) {
                if(BIT(d1, i) == 0)
                    continue;
                if(BIT(d2, i) == 1)
                    a[1] |= MASK(i);
            }
            break;
        } else
            cnt[x[i]] = i;
    }
    Write();

    return 0;
}


/*
 _____ _             _              _           _
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)
#define GG(a, b)	((a >> b) & 1)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_iss(x)  cerr << #x << " = " << x << endl;
#define what_is(x)  cerr << #x << " = " << x << " ";

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005
// #define LOG 	16
ll LOG;
vector<string> v = {"AND", "OR", "XOR"};

ll fun(int f, ll i, ll j) {
	cout << v[0] << " " << i + 1 << " " << j + 1 << endl;
	fflush(stdout);
	ll num;
	cin >> num;
	return num;
}

void solve()
{
	ll n;
	cin >> n;
	LOG = log2(n);
	/*
	    X A O
	0 0 0 0 0
	0 1 1 0 1
	1 0 1 0 1
	1 1 0 1 1
	*/
	vi v(n);
	vi mask(n);
	ll ps = -1,ps1 = -1;
	mask[0] = 0;
	map<ll,ll> ma;
	ma[0] = 1;
	rep(i, 1, n) {
		mask[i] = fun(2,0,i);
		if(ps == -1 && ma[mask[i]]) {
			ps = ma[mask[i]] - 1;
			ps1 = i;
		}
		ma[mask[i]] = i + 1;
	}
	if(ps == -1) {
		rep(i, 0, n) {
			if(mask[i] == 1) {
				ps = i;
			}
			if(!(mask[i] & 1)) {
				ps1 = i;
			}
		}
		ll num,num1;
		num = fun(0, 0, ps);
		num1 = fun(0, 0, ps1);
		v[0] = 0;
		rep(i, 1, LOG) {
			if(GG(num, i)) {
				v[0] |= (1 << i);
			}
		}
		if(num1 & 1) {
			v[0] |= 1;
		}
	} else {
		ll num = fun(1,ps,ps1);
		v[0] = v[ps] ^ num;
	}
	rep(i,1,n) {
		v[i] = v[0] ^ mask[i];
	}
	rep(i,0,n) {
		cout << v[i] << " ";
	}
	cout << endl;
	return;
}
int main()
{
	// FAST
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,TESTS)
    {
        // cout<<"Case #"<<i+1<<": ";
        solve();
    }
	// TIME
	return 0;
}


/*
 _____ _             _              _           _
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)
#define GG(a, b)	((a >> b) & 1)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_iss(x)  cerr << #x << " = " << x << endl;
#define what_is(x)  cerr << #x << " = " << x << " ";

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005
// #define LOG 	16
ll LOG;
vector<string> v = {"AND", "OR", "XOR"};

ll fun(int f, ll i, ll j) {
	cout << v[0] << " " << i << " " << j << endl;
	fflush(stdout);
	ll num;
	cin >> num;
	return num;
}

void solve()
{
	ll n;
	cin >> n;
	LOG = log2(n);
	/*
	    X A O
	0 0 0 0 0
	0 1 1 0 1
	1 0 1 0 1
	1 1 0 1 1
	*/
	vi v(n);
	vi mask(n);
	ll ps = -1,ps1 = -1;
	mask[0] = 0;
	map<ll,ll> ma;
	ma[0] = 1;
	rep(i, 1, n) {
		mask[i] = fun(2,0,i);
		if(ps == -1 && ma[mask[i]]) {
			ps = ma[mask[i]] - 1;
			ps1 = i;
		}
		ma[mask[i]] = i + 1;
	}
	if(ps == -1) {
		rep(i, 0, n) {
			if(mask[i] == 1) {
				ps = i;
			}
			if(!(mask[i] & 1)) {
				ps1 = i;
			}
		}
		ll num,num1;
		num = fun(0, 0, ps);
		num1 = fun(0, 0, ps1);
		v[0] = 0;
		rep(i, 1, LOG) {
			if(GG(num, i)) {
				v[0] |= (1 << i);
			}
		}
		if(num1 & 1) {
			v[0] |= 1;
		}
	} else {
		ll num = fun(1,ps,ps1);
		v[0] = v[ps] ^ num;
	}
	rep(i,1,n) {
		v[i] = v[0] ^ mask[i];
	}
	rep(i,0,n) {
		cout << v[i] << " ";
	}
	cout << endl;
	return;
}
int main()
{
	// FAST
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,TESTS)
    {
        // cout<<"Case #"<<i+1<<": ";
        solve();
    }
	// TIME
	return 0;
}


/*
 _____ _             _              _           _
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)
#define GG(a, b)	((a >> b) & 1)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_iss(x)  cerr << #x << " = " << x << endl;
#define what_is(x)  cerr << #x << " = " << x << " ";

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005
// #define LOG 	16
ll LOG;
vector<string> v = {"AND", "OR", "XOR"};

ll fun(int f, ll i, ll j) {
	cout << v[f] << " " << i + 1 << " " << j + 1 << endl;
	fflush(stdout);
	ll num;
	cin >> num;
	return num;
}

void solve()
{
	ll n;
	cin >> n;
	LOG = log2(n);
	/*
	    X A O
	0 0 0 0 0
	0 1 1 0 1
	1 0 1 0 1
	1 1 0 1 1
	*/
	vi v(n);
	vi mask(n);
	ll ps = -1,ps1 = -1;
	mask[0] = 0;
	map<ll,ll> ma;
	ma[0] = 1;
	rep(i, 1, n) {
		mask[i] = fun(2,0,i);
		if(ps == -1 && ma[mask[i]]) {
			ps = ma[mask[i]] - 1;
			ps1 = i;
		}
		ma[mask[i]] = i + 1;
	}
	if(ps == -1) {
		rep(i, 0, n) {
			if(mask[i] == 1) {
				ps = i;
			}
			if(!(mask[i] & 1)) {
				ps1 = i;
			}
		}
		ll num,num1;
		num = fun(0, 0, ps);
		num1 = fun(0, 0, ps1);
		v[0] = 0;
		rep(i, 1, LOG) {
			if(GG(num, i)) {
				v[0] |= (1 << i);
			}
		}
		if(num1 & 1) {
			v[0] |= 1;
		}
	} else {
		ll num = fun(0,ps,ps1);
		v[0] = v[ps] ^ num;
	}
	rep(i,1,n) {
		v[i] = v[0] ^ mask[i];
	}
	cout << "! ";
	rep(i,0,n) {
		cout << v[i] << " ";
	}
	cout << endl;
	fflush(stdout);
	return;
}
int main()
{
	// FAST
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,TESTS)
    {
        // cout<<"Case #"<<i+1<<": ";
        solve();
    }
	// TIME
	return 0;
}


/*
 _____ _             _              _           _
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)
#define GG(a, b)	((a >> b) & 1)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_iss(x)  cerr << #x << " = " << x << endl;
#define what_is(x)  cerr << #x << " = " << x << " ";

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005
// #define LOG 	16
ll LOG;
vector<string> v = {"AND", "OR", "XOR"};

ll fun(int f, ll i, ll j) {
	cout << v[f] << " " << i + 1 << " " << j + 1 << endl;
	fflush(stdout);
	ll num;
	cin >> num;
	if(num == -1) {
		exit(0);
	}
	return num;
}

void solve()
{
	ll n;
	cin >> n;
	LOG = log2(n);
	/*
	    X A O
	0 0 0 0 0
	0 1 1 0 1
	1 0 1 0 1
	1 1 0 1 1
	*/
	vi v(n);
	vi mask(n);
	ll ps = -1,ps1 = -1;
	mask[0] = 0;
	map<ll,ll> ma;
	ma[0] = 1;
	rep(i, 1, n) {
		mask[i] = fun(2,0,i);
		if(ps == -1 && ma[mask[i]]) {
			ps = ma[mask[i]] - 1;
			ps1 = i;
		}
		ma[mask[i]] = i + 1;
	}
	if(ps == -1) {
		rep(i, 1, n) {
			if(mask[i] == 1) {
				ps = i;
			}
			if(!(mask[i] & 1)) {
				ps1 = i;
			}
		}
		ll num,num1;
		num = fun(0, 0, ps);
		num1 = fun(0, 0, ps1);
		v[0] = 0;
		rep(i, 1, LOG) {
			if(GG(num, i)) {
				v[0] += (1 << i);
			}
		}
		if(num1 & 1) {
			v[0] |= 1;
		}
	} else {
		ll num = fun(0,ps,ps1);
		v[0] = mask[ps] ^ num;
	}
	rep(i,1,n) {
		v[i] = v[0] ^ mask[i];
	}
	cout << "! ";
	rep(i,0,n) {
		cout << v[i] << " ";
	}
	cout << endl;
	fflush(stdout);
	return;
}
int main()
{
	// FAST
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,TESTS)
    {
        // cout<<"Case #"<<i+1<<": ";
        solve();
    }
	// TIME
	return 0;
}


/*
 _____ _             _              _           _
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)
#define GG(a, b)	((a >> b) & 1)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_iss(x)  cerr << #x << " = " << x << endl;
#define what_is(x)  cerr << #x << " = " << x << " ";

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005
// #define LOG 	16
ll LOG;
vector<string> v = {"AND", "OR", "XOR"};

ll fun(int f, ll i, ll j) {
	cout << v[f] << " " << i + 1 << " " << j + 1 << endl;
	fflush(stdout);
	ll num;
	cin >> num;
	return num;
}

void solve()
{
	ll n;
	cin >> n;
	LOG = log2(n);
	/*
	    X A O
	0 0 0 0 0
	0 1 1 0 1
	1 0 1 0 1
	1 1 0 1 1
	*/
	vi v(n);
	vi mask(n);
	ll ps = -1,ps1 = -1;
	mask[0] = 0;
	map<ll,ll> ma;
	ma[0] = 1;
	rep(i, 1, n) {
		mask[i] = fun(2,0,i);
		if(ps == -1 && ma[mask[i]]) {
			ps = ma[mask[i]] - 1;
			ps1 = i;
		}
		ma[mask[i]] = i + 1;
	}
	if(ps == -1) {
		rep(i, 0, n) {
			if(mask[i] == 1) {
				ps = i;
			}
			if(!(mask[i] & 1)) {
				ps1 = i;
			}
		}
		ll num,num1;
		num = fun(0, 0, ps);
		num1 = fun(0, 0, ps1);
		v[0] = 0;
		rep(i, 1, LOG) {
			if(GG(num, i)) {
				v[0] |= (1 << i);
			}
		}
		if(num1 & 1) {
			v[0] |= 1;
		}
	} else {
		ll num = fun(0,ps,ps1);
		v[0] = v[ps] ^ num;
	}
	rep(i,1,n) {
		v[i] = v[0] ^ mask[i];
	}
	rep(i,0,n) {
		cout << v[i] << " ";
	}
	cout << endl;
	return;
}
int main()
{
	// FAST
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,TESTS)
    {
        // cout<<"Case #"<<i+1<<": ";
        solve();
    }
	// TIME
	return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = (1 << 16) + 5;
const int INF = 1e9;

int xr[N];
map<int, int> Map;

int main()
{
    int n;
    scanf("%d", &n);
    int ok = 0, x, y, z, pos, a, posx, posy;
    for (int i = 2; i <= n; i++)
    {
        printf("XOR 1 %d\n\n", i);
        fflush(stdout);
        scanf("%d", &xr[i]);
        if (!Map[xr[i]]) Map[xr[i]] = i;
        else posx = i, posy = Map[xr[i]];
        if (xr[i] == n - 1)
        {
            ok = 1;
            pos = i;
        }
    }
    if (ok)
    {
        if (pos == n)
        {
            x = 0;
            printf("AND 1 %d\n", pos - 1);
            fflush(stdout);
            scanf("%d", &y);
            printf("AND %d %d\n", pos, pos - 1);
            fflush(stdout);
            scanf("%d", &z);
            x = xr[pos];
            y = xr[pos - 1] + 2 * y;
            z = (xr[pos - 1] ^ xr[pos]) + 2 * z;
            a = (x + y + z) / 2 - z;
        }
        else
        {
            x = 0;
            printf("AND 1 %d\n", pos + 1);
            fflush(stdout);
            scanf("%d", &y);
            printf("AND %d %d\n", pos, pos + 1);
            fflush(stdout);
            scanf("%d", &z);
            x = xr[pos];
            y = xr[pos + 1] + 2 * y;
            z = (xr[pos + 1] ^ xr[pos]) + 2 * z;
            a = (x + y + z) / 2 - z;
        }
    }
    else
    {
        int a;
        printf("AND %d %d\n", posx, posy);
        fflush(stdout);
        scanf("%d", &a);
        a = xr[posx] ^ a;
    }
    printf("! %d", a);
    for (int i = 2; i <= n; i++) printf(" %d", xr[i] ^ a);
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = (1 << 16) + 5;
const int INF = 1e9;

int xr[N];
map<int, int> Map;

int main()
{
    int n;
    scanf("%d", &n);
    int ok = 0, x, y, z, pos, a, posx, posy;
    for (int i = 2; i <= n; i++)
    {
        printf("XOR 1 %d\n\n", i);
        fflush(stdout);
        scanf("%d", &xr[i]);
        if (!Map[xr[i]]) Map[xr[i]] = i;
        else posx = i, posy = Map[xr[i]], ok = 1;
        if (xr[i] == n - 1) pos = i;
    }
    if (!ok)
    {
        if (pos == n)
        {
            x = 0;
            printf("AND 1 %d\n", pos - 1);
            fflush(stdout);
            scanf("%d", &y);
            printf("AND %d %d\n", pos, pos - 1);
            fflush(stdout);
            scanf("%d", &z);
            x = xr[pos];
            y = xr[pos - 1] + 2 * y;
            z = (xr[pos - 1] ^ xr[pos]) + 2 * z;
            a = (x + y + z) / 2 - z;
        }
        else
        {
            x = 0;
            printf("AND 1 %d\n", pos + 1);
            fflush(stdout);
            scanf("%d", &y);
            printf("AND %d %d\n", pos, pos + 1);
            fflush(stdout);
            scanf("%d", &z);
            x = xr[pos];
            y = xr[pos + 1] + 2 * y;
            z = (xr[pos + 1] ^ xr[pos]) + 2 * z;
            a = (x + y + z) / 2 - z;
        }
    }
    else
    {
        printf("AND %d %d\n", posx, posy);
        fflush(stdout);
        scanf("%d", &a);
        a = xr[posx] ^ a;
    }
    printf("! %d", a);
    for (int i = 2; i <= n; i++) printf(" %d", xr[i] ^ a);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resize(unique(a.begin(),a.end())-a.begin());
const ll mod=998244353;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,a,b,c,d,e, num=0;
    cin>>n;
    vector<ll> x(n+1);
    map<ll,ll> mpp;
    pair<ll,ll> p={0,0};
    ll k=-1, s=-1;
    vector<ll> ans(n+1,0);
    for(ll i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cin>>x[i];
        if(x[i]==0)
            s=i;
        if(mpp.find(x[i])!=mpp.end())
            p={mpp[x[i]],i};
        mpp[x[i]]=i;
        if(x[i]==n-1)
            k=i;
    }
    if(k!=-1){
        ll r=2;
        if(k==2) r++;
        a=x[r];
        b=x[k];
        cout<<"AND 1 "<<r<<endl;
        cin>>c;
        d=0;
        cout<<"AND "<<r<<" "<<k<<endl;
        cin>>e;
    }
    else if(s!=-1){
        cout<<"AND 1 "<<s<<endl;
        cin>>a;
        ans[1]=a;
        goto a1;
    }
    else{
        assert(p.first!=0);
        a=x[p.first];
        b=x[p.second];
        cout<<"AND 1 "<<p.first<<endl;
        cin>>c;
        d=c;
        cout<<"AND "<<p.second<<" "<<p.first<<endl;
        cin>>e;
    }
    for(ll i=0;i<25;i++){
        ll b1=0, b2=0, b3=0, b4=0, b5=0;
        if((a&(1<<i))!=0) b1=1;
        if((b&(1<<i))!=0) b2=1;
        if((c&(1<<i))!=0) b3=1;
        if((d&(1<<i))!=0) b4=1;
        if((e&(1<<i))!=0) b5=1;
        if(b1==0){
            if(b3==1)
                num+=(1<<i);
        }
        else if(b2==0){
            if(b4==1)
                num+=(1<<i);
        }
        else{
            assert(b1==1 && b2==1);
            if(b5==0)
                num+=(1<<i);
        }
    }
    ans[1]=num;
a1: for(ll j=2;j<=n;j++){
        k=x[j];
        ll num=ans[1];
        for(ll i=0;i<25;i++){
            ll b1=0, b2=0;
            if((k&(1<<i))!=0) b1=1;
            if((num&(1<<i))!=0) b2=1;
            //ll m=b1^b2;
            if((b1==1 && b2==0) || (b1==0 && b2==1))
                ans[j]+=(1<<i);
        }
    }
    cout<<"! ";
    for(ll i=1;i<=n;i++)
        cout<<ans[i]<<" ";

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resize(unique(a.begin(),a.end())-a.begin());
const ll mod=998244353;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,a,b,c,d,e;
    cin>>n;
    vector<ll> x(n+1);
    map<ll,ll> mpp;
    pair<ll,ll> p={0,0};
    ll k=-1, s=-1;
    for(ll i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cin>>x[i];
        if(x[i]==0)
            s=i;
        if(mpp.find(x[i])!=mpp.end())
            p={mpp[x[i]],i};
        mpp[x[i]]=i;
        if(x[i]==n-1)
            k=i;
    }
    if(k!=-1){
        ll r=2;
        if(k==2) r++;
        a=x[r];
        b=x[k];
        cout<<"AND 1 "<<r<<endl;
        cin>>c;
        d=0;
        cout<<"AND "<<r<<" "<<k<<endl;
        cin>>e;
    }
    else if(s!=-1){
        ll r=2;
        if(s==2) r++;
        a=x[r];
        b=0;
        cout<<"AND 1 "<<r<<endl;
        cin>>c;
        cout<<"AND 1 "<<s<<endl;
        cin>>d;
        e=c;
    }
    else{
        assert(p.first!=0);
        a=x[p.first];
        b=x[p.second];
        cout<<"AND 1 "<<p.first<<endl;
        cin>>c;
        d=c;
        cout<<"AND "<<p.second<<" "<<p.first<<endl;
        cin>>e;
    }
    vector<ll> ans(n+1,0);
    ll num=0;
    for(ll i=0;i<25;i++){
        ll b1=0, b2=0, b3=0, b4=0, b5=0;
        if((a&(1<<i))!=0) b1=1;
        if((b&(1<<i))!=0) b2=1;
        if((c&(1<<i))!=0) b3=1;
        if((d&(1<<i))!=0) b4=1;
        if((e&(1<<i))!=0) b5=1;
        if(b1==0){
            if(b3==1)
                num+=(1<<i);
        }
        else if(b2==0){
            if(b4==1)
                num+=(1<<i);
        }
        else{
            assert(b1==1 && b2==1);
            if(b5==0)
                num+=(1<<i);
        }
    }
    ans[1]=num;
    for(ll j=2;j<=n;j++){
        k=x[j];
        ll num=ans[1];
        for(ll i=0;i<25;i++){
            ll b1=0, b2=0;
            if((k&(1<<i))!=0) b1=1;
            if((num&(1<<i))!=0) b2=1;
            //ll m=b1^b2;
            if((b1==1 && b2==0) || (b1==0 && b2==1))
                ans[j]+=(1<<i);
        }
    }
    cout<<"! ";
    for(ll i=1;i<=n;i++)
        cout<<ans[i]<<" ";

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resize(unique(a.begin(),a.end())-a.begin());
const ll mod=998244353;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,a,b,c,d,e;
    cin>>n;
    vector<ll> x(n+1);
    map<ll,ll> mpp;
    pair<ll,ll> p={0,0};
    ll k=-1;
    for(ll i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cin>>x[i];
        if(mpp.find(x[i])!=mpp.end())
            p={mpp[x[i]],i};
        mpp[x[i]]=i;
        if(x[i]==n-1)
            k=i;
    }
    if(k!=-1){
        a=x[2];
        b=x[k];
        cout<<"AND 1 2"<<endl;
        cin>>c;
        d=0;
        cout<<"AND 2 "<<k<<endl;
        cin>>e;
    }
    else{
        assert(p.first!=0);
        a=x[p.first];
        b=x[p.second];
        cout<<"AND 1 "<<p.first<<endl;
        cin>>c;
        d=c;
        cout<<"AND "<<p.second<<" "<<p.first<<endl;
        cin>>e;
    }
    vector<ll> ans(n+1,0);
    ll num=0;
    for(ll i=0;i<25;i++){
        ll b1=0, b2=0, b3=0, b4=0, b5=0;
        if((a&(1<<i))!=0) b1=1;
        if((b&(1<<i))!=0) b2=1;
        if((c&(1<<i))!=0) b3=1;
        if((d&(1<<i))!=0) b4=1;
        if((e&(1<<i))!=0) b5=1;
        if(b1==0){
            if(b3==1)
                num+=(1<<i);
        }
        else if(b2==0){
            if(b4==1)
                num+=(1<<i);
        }
        else{
            assert(b1==1 && b2==1);
            if(b5==0)
                num+=(1<<i);
        }
    }
    ans[1]=num;
    for(ll j=2;j<=n;j++){
        k=x[j];
        ll num=ans[1];
        for(ll i=0;i<25;i++){
            ll b1=0, b2=0;
            if((k&(1<<i))!=0) b1=1;
            if((num&(1<<i))!=0) b2=1;
            //ll m=b1^b2;
            if((b1==1 && b2==0) || (b1==0 && b2==1))
                ans[j]+=(1<<i);
        }
    }
    cout<<"! ";
    for(ll i=1;i<=n;i++)
        cout<<ans[i]<<" ";

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resize(unique(a.begin(),a.end())-a.begin());
const ll mod=998244353;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,a,b,c,d,e;
    cin>>n;
    vector<ll> x(n+1);
    map<ll,ll> mpp;
    pair<ll,ll> p={0,0};
    ll k=-1, s=-1;
    vector<ll> ans(n+1,0);
    for(ll i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cin>>x[i];
        if(x[i]==0)
            s=i;
        if(mpp.find(x[i])!=mpp.end())
            p={mpp[x[i]],i};
        mpp[x[i]]=i;
        if(x[i]==n-1)
            k=i;
    }
    if(k!=-1){
        ll r=2;
        if(k==2) r++;
        a=x[r];
        b=x[k];
        cout<<"AND 1 "<<r<<endl;
        cin>>c;
        d=0;
        cout<<"AND "<<r<<" "<<k<<endl;
        cin>>e;
    }
    else if(s!=-1){
        cout<<"AND 1 "<<s<<endl;
        cin>>a;
        ans[1]=a;
        goto a1;
    }
    else{
        assert(p.first!=0);
        a=x[p.first];
        b=x[p.second];
        cout<<"AND 1 "<<p.first<<endl;
        cin>>c;
        d=c;
        cout<<"AND "<<p.second<<" "<<p.first<<endl;
        cin>>e;
    }
    ll num=0;
    for(ll i=0;i<25;i++){
        ll b1=0, b2=0, b3=0, b4=0, b5=0;
        if((a&(1<<i))!=0) b1=1;
        if((b&(1<<i))!=0) b2=1;
        if((c&(1<<i))!=0) b3=1;
        if((d&(1<<i))!=0) b4=1;
        if((e&(1<<i))!=0) b5=1;
        if(b1==0){
            if(b3==1)
                num+=(1<<i);
        }
        else if(b2==0){
            if(b4==1)
                num+=(1<<i);
        }
        else{
            assert(b1==1 && b2==1);
            if(b5==0)
                num+=(1<<i);
        }
    }
    ans[1]=num;
a1: for(ll j=2;j<=n;j++){
        k=x[j];
        ll num=ans[1];
        for(ll i=0;i<25;i++){
            ll b1=0, b2=0;
            if((k&(1<<i))!=0) b1=1;
            if((num&(1<<i))!=0) b2=1;
            //ll m=b1^b2;
            if((b1==1 && b2==0) || (b1==0 && b2==1))
                ans[j]+=(1<<i);
        }
    }
    cout<<"! ";
    for(ll i=1;i<=n;i++)
        cout<<ans[i]<<" ";

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resize(unique(a.begin(),a.end())-a.begin());
const ll mod=998244353;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,a,b,c,d,e;
    cin>>n;
    vector<ll> x(n+1);
    map<ll,ll> mpp;
    pair<ll,ll> p={0,0};
    ll k=-1;
    for(ll i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cin>>x[i];
        if(mpp.find(x[i])!=mpp.end())
            p={mpp[x[i]],i};
        mpp[x[i]]=i;
        if(x[i]==n-1)
            k=i;
    }
    if(k!=-1){
        a=x[2];
        b=x[k];
        cout<<"AND 1 2"<<endl;
        cin>>c;
        d=0;
        cout<<"AND 2 "<<k<<endl;
        cin>>e;
    }
    else{
        assert(p.first!=0);
        a=x[p.first];
        b=x[p.second];
        cout<<"AND 1 "<<p.first<<endl;
        cin>>c;
        d=c;
        cout<<"AND "<<p.second<<" "<<p.first<<endl;
        cin>>e;
    }
    vector<ll> ans(n+1,0);
    for(ll i=0;i<25;i++){
        ll b1=0, b2=0, b3=0, b4=0, b5=0;
        if((a&(1<<i))!=0) b1=1;
        if((b&(1<<i))!=0) b2=1;
        if((c&(1<<i))!=0) b3=1;
        if((d&(1<<i))!=0) b4=1;
        if((e&(1<<i))!=0) b5=1;
        if(b1==0){
            if(b3==1)
                num+=(1<<i);
        }
        else if(b2==0){
            if(b4==1)
                num+=(1<<i);
        }
        else{
            assert(b1==1 && b2==1);
            if(b5==0)
                num+=(1<<i);
        }
    }
    ans[1]=num;
    for(ll j=2;j<=n;j++){
        k=x[j];
        ll num=ans[1];
        for(ll i=0;i<25;i++){
            ll b1=0, b2=0;
            if((k&(1<<i))!=0) b1=1;
            if((num&(1<<i))!=0) b2=1;
            //ll m=b1^b2;
            if((b1==1 && b2==0) || (b1==0 && b2==1))
                ans[j]+=(1<<i);
        }
    }
    cout<<"! ";
    for(ll i=1;i<=n;i++)
        cout<<ans[i]<<" ";

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    int and_ij,and_jk,and_ik;
    int xor_ij,xor_jk;
    map<int,int>xor_mp;
    string s="XOR 1";
    xor_mp[0]=1;
    int f_i,s_i;
    int f=1;int x=-1;
    int xor_v[n+1];int ans_v[n+1];
    for(int i=2;i<=n;i++){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        if(xor_mp.find(xor_ij)==xor_mp.end()){
            xor_mp[xor_ij]=i;
            xor_v[i]=xor_ij;
        }
        else if(xor_ij==0){
            string s_s="AND 1 ";
            cout<<s_s<<i<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            xor_v[i]=xor_ij;
            if(and_ij==-1)return 0;
            ans_v[1]=ans_v[i]=and_ij;
            f=0;
            for(int k=2;k<i;k++){
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
        else {
            f_i=xor_mp[xor_ij];
            s_i=i;f=0;
            xor_v[s_i]=xor_ij;
            string s_s="AND ";
            cout<<s_s<<f_i<<" "<<s_i<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            if(and_ij==-1)return 0;
            ans_v[f_i]=ans_v[s_i]=and_ij;
            ans_v[1]=(ans_v[f_i]^xor_ij);
            for(int k=2;k<i;k++){
                if(k==f_i)continue;
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
    }
    if(f==0){
        for(int k=x+1;k<=n;k++){
            string s_s="XOR 1 ";
            cout<<s_s<<k<<endl;
            cout.flush();
            cin>>xor_ij;
            if(xor_ij==-1)return 0;
            ans_v[k]=(ans_v[1]^xor_ij);
        }
    }
    else if(f==1){
        int j=xor_mp[n-1];
        and_ij=0;
        int k;
        if(j==2)k=3;
        else k=2;
        string s_s="AND 1 ";
        cout<<s_s<<k<<endl;
        cout.flush();cin>>and_ik;if(and_ik==-1)return 0;
        s_s="AND ";
        cout<<s_s<<j<<" "<<k<<endl;
        cout.flush();cin>>and_jk;if(and_jk==-1)return 0;
        xor_jk=(xor_v[j]^xor_v[k]);
        xor_ij=xor_v[j];int xor_ik=xor_v[k];
        int a1pa2=xor_ij+2*and_ij;int a1pa3=xor_ik+2*and_ik;
        int a2pa3=xor_jk+2*and_jk;
        int a1pa2pa3=(a1pa2+a1pa3+a2pa3)/2;
        ans_v[1]=a1pa2pa3-a2pa3;
        ans_v[j]=a1pa2pa3-a1pa3;ans_v[k]=a1pa2pa3-a1pa2;
        for(int i=2;i<=n;i++){
            if(i==j || i==k)continue;
            ans_v[i]=(ans_v[1]^xor_v[i]);
        }
    }
    cout<<"!"<<" ";
    for(int i=1;i<=n;i++)
    cout<<ans_v[i]<<" ";
    cout<<endl;
    cout.flush();
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    int and_ij,and_jk,and_ik;
    int xor_ij,xor_jk;
    map<int,int>xor_mp;
    string s="XOR 1";
    xor_mp[0]=1;
    int f_i,s_i;
    int f=1;int x=-1;
    int xor_v[n+1];int ans_v[n+1];
    for(int i=2;i<=n;i++){
        cout<<s+" "+to_string(i)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        if(xor_mp.find(xor_ij)==xor_mp.end()){
            xor_mp[xor_ij]=i;
            xor_v[i]=xor_ij;
        }
        else if(xor_ij==0){
            string s_s="AND";
            cout<<s_s+" "+to_string(1)+" "+to_string(i)<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            if(and_ij==-1)return 0;
            ans_v[1]=ans_v[i]=and_ij;
            f=0;
            for(int k=2;k<i;k++){
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
        else {
            f_i=xor_mp[xor_ij];
            s_i=i;f=0;
            xor_v[s_i]=xor_ij;
            string s_s="AND";
            cout<<s_s+" "+to_string(f_i)+" "+to_string(s_i)<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            if(and_ij==-1)return 0;
            ans_v[f_i]=ans_v[s_i]=and_ij;
            ans_v[1]=(ans_v[f_i]^xor_ij);
            for(int k=2;k<i;k++){
                if(k==f_i)continue;
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
    }
    for(int k=x+1;k<=n;k++){
        string s_s="XOR 1";
        cout<<s_s+" "+to_string(k)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        ans_v[k]=(ans_v[1]^xor_ij);
    }
    if(f==1){
        int j=xor_mp[n-1];
        and_ij=0;
        int k;
        if(j==2)k=3;
        else k=2;
        string s_s="AND 1";
        cout<<s_s+" "+to_string(k)<<endl;
        cout.flush();cin>>and_ik;if(and_ik==-1)return 0;
        s_s="AND";
        cout<<s_s+" "+to_string(j)+" "+to_string(k)<<endl;
        cout.flush();cin>>and_jk;if(and_jk==-1)return 0;
        xor_jk=(xor_v[j]^xor_v[k]);
        xor_ij=xor_v[j];int xor_ik=xor_v[k];
        int a1pa2=xor_ij+2*and_ij;int a1pa3=xor_ik+2*and_ik;
        int a2pa3=xor_jk+2*and_jk;
        int a1pa2pa3=(a1pa2+a1pa3+a2pa3)/2;
        ans_v[1]=a1pa2pa3-a2pa3;
        ans_v[j]=a1pa2pa3-a1pa3;ans_v[k]=a1pa2pa3-a1pa2;
        for(int i=2;i<=n;i++){
            if(i==j || i==k)continue;
            ans_v[i]=(ans_v[1]^xor_v[i]);
        }
    }
    cout<<"!"<<" ";
    for(int i=1;i<=n;i++)
    cout<<ans_v[i]<<" ";
    cout<<endl;
    cout.flush();
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    int and_ij,and_jk,and_ik;
    int xor_ij,xor_jk;
    map<int,int>xor_mp;
    string s="XOR 1";
    xor_mp[0]=1;
    int f_i,s_i;
    int f=1;int x=-1;
    int xor_v[n+1];int ans_v[n+1];
    for(int i=2;i<=n;i++){
        cout<<s+" "+to_string(i)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        if(xor_mp.find(xor_ij)==xor_mp.end()){
            xor_mp[xor_ij]=i;
            xor_v[i]=xor_ij;
        }
        else if(xor_ij==0){
            string s_s="AND";
            cout<<s_s+" "+to_string(1)+" "+to_string(i)<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            if(and_ij==-1)return 0;
            ans_v[1]=ans_v[i]=and_ij;
            f=0;
            for(int k=2;k<i;k++){
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
        else {
            f_i=xor_mp[xor_ij];
            s_i=i;f=0;
            xor_v[s_i]=xor_ij;
            string s_s="AND";
            cout<<s_s+" "+to_string(f_i)+" "+to_string(s_i)<<endl;
            cout.flush();
            cin>>and_ij;x=i;
            if(and_ij==-1)return 0;
            ans_v[f_i]=ans_v[s_i]=and_ij;
            ans_v[1]=(ans_v[f_i]^xor_ij);
            for(int k=2;k<i;k++){
                if(k==f_i)continue;
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
    }
    for(int k=x+1;k<=n;k++){
        string s_s="XOR 1";
        cout<<s_s+" "+to_string(k)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        ans_v[k]=(ans_v[1]^xor_ij);
    }
    if(f==1){
        int j=xor_mp[n-1];
        and_ij=0;
        int k;
        if(j==2)k=3;
        else k=2;
        s="AND 1";
        cout<<s+" "+to_string(k)<<endl;
        cout.flush();cin>>and_ik;if(and_ik==-1)return 0;
        s="AND";
        cout<<s+" "+to_string(j)+" "+to_string(k)<<endl;
        cout.flush();cin>>and_jk;if(and_jk==-1)return 0;
        xor_jk=(xor_v[j]^xor_v[k]);
        xor_ij=xor_v[j];int xor_ik=xor_v[k];
        int a1pa2=xor_ij+2*and_ij;int a1pa3=xor_ik+2*and_ik;
        int a2pa3=xor_jk+2*and_jk;
        int a1pa2pa3=(a1pa2+a1pa3+a2pa3)/2;
        ans_v[1]=a1pa2pa3-a2pa3;
        ans_v[2]=a1pa2pa3-a1pa3;ans_v[3]=a1pa2pa3-a1pa2;
        for(int i=2;i<=n;i++){
            if(i==j || i==k)continue;
            ans_v[i]=(ans_v[1]^xor_v[i]);
        }
    }
    cout<<"!"<<" ";
    for(int i=1;i<=n;i++)
    cout<<ans_v[i]<<" ";
    cout<<endl;
    cout.flush();
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    int and_ij,and_jk,and_ik;
    int xor_ij,xor_jk;
    map<int,int>xor_mp;
    string s="XOR 1";
    xor_mp[0]=1;int i;
    int f_i,s_i;
    int f=1;
    int xor_v[n+1];int ans_v[n+1];
    for(i=2;i<=n;i++){
        cout<<s+" "+to_string(i)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        if(xor_mp.find(xor_ij)==xor_mp.end()){
            xor_mp[xor_ij]=i;
            xor_v[i]=xor_ij;
        }
        else if(xor_ij==0){
            cout<<"AND "+to_string(1)+" "+to_string(i)<<endl;
            cout.flush();
            cin>>and_ij;
            if(and_ij==-1)return 0;
            ans_v[1]=ans_v[i]=and_ij;
            f=0;
            for(int k=2;k<i;k++){
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
        else {
            f_i=xor_mp[xor_ij];
            s_i=i;f=0;
            xor_v[s_i]=xor_ij;
            cout<<"AND "+to_string(f_i)+" "+to_string(s_i)<<endl;
            cout.flush();
            cin>>and_ij;
            if(and_ij==-1)return 0;
            ans_v[f_i]=ans_v[s_i]=and_ij;
            ans_v[1]=(ans_v[f_i]^xor_ij);
            for(int k=2;k<i;k++){
                if(k==f_i)continue;
                ans_v[k]=(ans_v[1]^xor_v[k]);
            }
            break;
        }
    }
    for(int k=i+1;k<=n;k++){
        cout<<s+" "<<to_string(k)<<endl;
        cout.flush();
        cin>>xor_ij;
        if(xor_ij==-1)return 0;
        ans_v[k]=(ans_v[1]^xor_ij);
    }
    if(f==1){
        int j=xor_mp[n-1];
        and_ij=0;
        int k;
        if(j==2)k=3;
        else j=2;
        s="AND 1";
        cout<<s+" "+to_string(k)<<endl;
        cout.flush();cin>>and_ik;if(and_ik==-1)return 0;
        s="AND";
        cout<<s+" "+to_string(j)+" "+to_string(k)<<endl;
        cout.flush();cin>>and_jk;if(and_jk==-1)return 0;
        xor_jk=(xor_v[j]^xor_v[k]);
        xor_ij=xor_v[j];int xor_ik=xor_v[k];
        int a1pa2=xor_ij+2*and_ij;int a1pa3=xor_ik+2*and_ik;
        int a2pa3=xor_jk+2*and_jk;
        int a1pa2pa3=(a1pa2+a1pa3+a2pa3)/2;
        ans_v[1]=a1pa2pa3-a2pa3;
        ans_v[2]=a1pa2pa3-a1pa3;ans_v[3]=a1pa2pa3-a1pa2;
        for(int i=2;i<=n;i++){
            if(i==j || i==k)continue;
            ans_v[i]=(ans_v[1]^xor_v[i]);
        }
    }
    cout<<"!"<<" ";
    for(int i=1;i<=n;i++)
    cout<<ans_v[i]<<" ";
    cout<<endl;
    cout.flush();
    return 0;
}


#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn = 100010;

int p[maxn];
vector<int> c[maxn];

int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 2; i <= n; ++i) {
        printf("XOR %d %d\n", 1, i);
        fflush(stdout);
        scanf("%d", &p[i]);
        c[p[i]].push_back(i);
    }
    int num = -1;
    for (int i = 0; i < n; ++i) {
        if (c[i].size() >= 2) {
            num = i;
            break;
        }
    }
    if (num != -1) {
        printf("AND %d %d\n", c[num][0], c[num][1]);
        fflush(stdout);
        int ret;
        scanf("%d", &ret);
        ret = (p[c[num][0]] ^ ret);
        printf("! %d ", ret);
        for (int i = 2; i <= n; ++i) {
            printf("%d ", p[i] ^ ret);
        }
        puts("");
        fflush(stdout);
    } else {
        int x, y;
        for (int i = 2; i <= 3; ++i) {
            for (int j = i + 1; j <= n; ++j) {
                if ((p[i] ^ p[j]) == n - 1) {
                    x = i, y = j;
                }
            }
        }
        printf("AND %d %d\n", 1, x);
        fflush(stdout);
        int c;
        scanf("%d", &c);
        printf("AND %d %d\n", 1, y);
        fflush(stdout);
        int d;
        scanf("%d", &d);
        x = (((p[x] + c + c) + ((p[x] ^ p[y])) - (p[y] + d + d)) / 2) ^ p[x];
        printf("! %d ", x);
        for (int i = 2; i <= n; ++i) {
            printf("%d ", p[i] ^ x);
        }
        puts("");
        fflush(stdout);
    }
    return 0;
}


#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn = 100010;

int p[maxn];
vector<int> c[maxn];

int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 2; i <= n; ++i) {
        printf("XOR %d %d\n", 1, i);
        fflush(stdout);
        scanf("%d", &p[i]);
        c[p[i]].push_back(i);
    }
    int num = -1;
    for (int i = 0; i < n; ++i) {
        if (c[i].size() >= 2) {
            num = i;
            break;
        }
    }
    if (num != -1) {
        printf("AND %d %d\n", c[num][0], c[num][1]);
        fflush(stdout);
        int ret;
        scanf("%d", &ret);
        ret = (p[c[num][0]] ^ ret);
        printf("! %d ", ret);
        for (int i = 2; i <= n; ++i) {
            printf("%d ", p[i] ^ ret);
        }
        puts("");
        fflush(stdout);
    } else {
        int x, y;
        for (int i = 2; i <= 3; ++i) {
            for (int j = i + 1; j <= n; ++j) {
                if (p[j] == n - 1) {
                    x = i, y = j;
                }
            }
        }
        printf("AND %d %d\n", 1, x);
        fflush(stdout);
        int c;
        scanf("%d", &c);
        printf("AND %d %d\n", x, y);
        fflush(stdout);
        int d;
        scanf("%d", &d);
        x = (((p[x] + c + c) + ((p[x] ^ p[y]) + d + d) - (p[y])) / 2) ^ p[x];
        printf("! %d ", x);
        for (int i = 2; i <= n; ++i) {
            printf("%d ", p[i] ^ x);
        }
        puts("");
        fflush(stdout);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector<int> adj[1<<16];
int ans[1<<16];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        printf("XOR %d %d\n",1,i+1);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        adj[x].push_back(i+1);
    }
    bool flag=false;
    for(int i=0;i<(1<<16);i++){
        if(i==0 && adj[i].size()){
            printf("OR %d %d\n",adj[i][0],1);
            fflush(stdout);
            int x;
            scanf("%d",&x);
            ans[1]=x;
            for(int j=0;j<(1<<16);j++){
                for(auto k:adj[j]){
                    ans[k] = j^x;
                }
            }
            flag=true;
            break;
        }
        if(adj[i].size()>1){
            printf("OR %d %d\n",adj[i][0],adj[i][1]);
            fflush(stdout);
            int x;
            scanf("%d",&x);
            ans[1] = i^x;
            for(int j=0;j<(1<<16);j++){
                for(auto k:adj[j]){
                    ans[k] = j^i^x;
                }
            }
            flag=true;
            break;
        }
    }

    if(!flag){
        int a,b;
        printf("AND %d %d\n",1,adj[1][0]);
        fflush(stdout);
        scanf("%d",&a);
        printf("AND %d %d\n",1,adj[n-2][0]);
        fflush(stdout);
        scanf("%d",&b);
        int x=a|b;
        ans[1]=x;
        for(int j=0;j<(1<<16);j++){
            for(auto k:adj[j]){
                ans[k]= j^x;
            }
        }
    }

    printf("!");
    for(int i=1;i<=n;i++){
        printf(" %d",ans[i]);
    }
    printf("\n");
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
int ans[100005];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        printf("XOR %d %d\n",1,i+1);
        fflush(stdout);
        int x;
        scanf("%d",&x);
        adj[x].push_back(i+1);
    }
    bool flag=false;
    for(int i=0;i<(1<<16);i++){
        if(i==0 && adj[i].size()){
            printf("OR %d %d\n",adj[i][0],1);
            fflush(stdout);
            int x;
            scanf("%d",&x);
            ans[1]=x;
            for(int j=0;j<(1<<16);j++){
                for(auto k:adj[j]){
                    ans[k] = j^x;
                }
            }
            flag=true;
            break;
        }
        if(adj[i].size()>1){
            printf("OR %d %d\n",adj[i][0],adj[i][1]);
            fflush(stdout);
            int x;
            scanf("%d",&x);
            ans[1] = i^x;
            for(int j=0;j<(1<<16);j++){
                for(auto k:adj[j]){
                    ans[k] = j^i^x;
                }
            }
            flag=true;
            break;
        }
    }

    if(!flag){
        int a,b;
        printf("AND %d %d\n",1,adj[1][0]);
        fflush(stdout);
        scanf("%d",&a);
        printf("AND %d %d\n",1,adj[n-2][0]);
        fflush(stdout);
        scanf("%d",&b);
        int x=a|b;
        ans[1]=x;
        for(int j=0;j<(1<<16);j++){
            for(auto k:adj[j]){
                ans[k]= j^x;
            }
        }
    }

    printf("!");
    for(int i=1;i<=n;i++){
        printf(" %d",ans[i]);
    }
    printf("\n");
    fflush(stdout);
    return 0;
}


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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	ll arr[n+1];
	ll ans[n+1];
	unordered_map<ll,ll> mp;
	int ok=0,x;
	for(int i=2;i<=n;i++){
		cout<<"XOR 1 "<<i<<"\n";
		cout.flush();
		cin>>arr[i];
		mp[arr[i]]++;
		if(mp[arr[i]]>1) ok=1,x=arr[i];
	}
	if(ok){
		int r=0,l=0;
		for(int i=2;i<=n;i++){
			if(arr[i]==x){
				if(!r) l=i;
				r=i;
			}
		}
		cout<<"AND "<<r<<" "<<l<<"\n";
		cout.flush();
		cin>>ans[r];
		ans[l]=ans[r];
		ans[1]=ans[l]^arr[l];
		for(int i=2;i<=n;i++){
			if(i==l || i==r) continue;
			ans[i]=ans[1]^arr[i];
		}
		cout<<"! ";
		for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
	}
	else{
		int l;												// 1, l, 2
		for(int i=2;i<=n;i++){
			if(arr[i]==n-1) l=i;
		}
		int r=2;
		if(l==2) r=3;
		int xor1=arr[l],xor2=arr[l]^arr[r],xor3=arr[r];			// xor1 + 2*and1 = ans[l] + ans[1]
		int and1=0,and2,and3;									// xor2 + 2*and2 = ans[l] + ans[r]
		cout<<"AND "<<l<<" "<<r<<"\n";							// xor3 + 2*and3 = ans[1] + ans[r]
		cout.flush();
		cin>>and2;
		cout<<"AND "<<1<<" "<<r<<"\n";
		cout.flush();
		cin>>and3;
		ans[l] = (xor1 + xor2 - xor3 + (2*(and1 + and2 - and3)))/2;
		ans[r] = xor2 + (2*and2) - ans[l];
		ans[1] = xor1 + (2*and1) - ans[l];
		for(int i=2;i<=n;i++){
			if(i==l || i==r) continue;
			ans[i]=ans[1]^arr[i];
		}
		cout<<"! ";
		for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
	}
}


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

int main(){
	//ios::sync_with_stdio(0);
	//cin.tie(0);
	//cout.tie(0);
	ll n;
	cin>>n;
	ll arr[n+1];
	ll ans[n+1];
	unordered_map<ll,ll> mp;
	int ok=0,x;
	for(int i=2;i<=n;i++){
		cout<<"XOR 1 "<<i<<"\n";
		cout.flush();
		cin>>arr[i];
		mp[arr[i]]++;
		if(mp[arr[i]]>1) ok=1,x=arr[i];
	}
	if(ok){
		int r=0,l=0;
		for(int i=2;i<=n;i++){
			if(arr[i]==x){
				if(!r) l=i;
				r=i;
			}
		}
		cout<<"AND "<<r<<" "<<l<<"\n";
		cout.flush();
		cin>>ans[r];
		ans[l]=ans[r];
		ans[1]=ans[l]^arr[l];
		for(int i=2;i<=n;i++){
			if(i==l || i==r) continue;
			ans[i]=ans[1]^arr[i];
		}
		cout<<"! ";
		for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
	}
	else{
		int l;												// 1, l, 2
		for(int i=2;i<=n;i++){
			if(arr[i]==n-1) l=i;
		}
		int r=2;
		if(l==2) r=3;
		int xor1=arr[l],xor2=arr[l]^arr[r],xor3=arr[r];			// xor1 + 2*and1 = ans[l] + ans[1]
		int and1=0,and2,and3;									// xor2 + 2*and2 = ans[l] + ans[r]
		cout<<"AND "<<l<<" "<<r<<"\n";							// xor3 + 2*and3 = ans[1] + ans[r]
		cout.flush();
		cin>>and2;
		cout<<"AND "<<1<<" "<<r<<"\n";
		cout.flush();
		cin>>and3;
		ans[l] = (xor1 + xor2 - xor3 + (2*(and1 + and2 - and3)))/2;
		ans[r] = xor2 + (2*and2) - ans[l];
		ans[1] = xor1 + (2*and1) - ans[l];
		for(int i=2;i<=n;i++){
			if(i==l || i==r) continue;
			ans[i]=ans[1]^arr[i];
		}
		cout<<"! ";
		for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,1,n) pos[xo[i]].pb(i);
    rep(i,0,n-1){
        if(pos[i].size()>=2){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y = 0, z = 0;
        bool ok = false;
        for(y = 2; y<=n; y++){
            for(z = y+1; z<=n; z++){
                if((xo[y]^xo[z])==n-1){
                    ok = true;
                    break;
                }
            }
            if(ok) break;
        }
        int axy, axz;
        cout<<"AND "<<x<<' '<<y<<endl;
        cout.flush();
        cin>>axy;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        int sxy, sxz, syz;
        sxy = xo[y] + 2*axy;
        sxz = xo[z] + 2*axz;
        syz = (n-1);
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,2,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=2){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y = 0, z = 0;
        bool ok = false;
        for(y = 2; y<=n; y++){
            for(z = y+1; z<=n; z++){
                if((xo[y]^xo[z])==n-1){
                    ok = true;
                    break;
                }
            }
            if(ok) break;
        }
        int axy, axz;
        cout<<"AND "<<x<<' '<<y<<endl;
        cout.flush();
        cin>>axy;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        int sxy, sxz, syz;
        sxy = xo[y] + 2*axy;
        sxz = xo[z] + 2*axz;
        syz = (n-1);
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,1,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=2){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y = 0, z = 0;
        bool ok = false;
        for(y = 2; y<=n; y++){
            for(z = y+1; z<=n; z++){
                if((xo[y]^xo[z])==n-1){
                    ok = true;
                    break;
                }
            }
            if(ok) break;
        }
        int axy, axz;
        cout<<"AND "<<x<<' '<<y<<endl;
        cout.flush();
        cin>>axy;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        int sxy, sxz, syz;
        sxy = xo[y] + 2*axy;
        sxz = xo[z] + 2*axz;
        syz = (n-1);
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
//    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,2,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=2){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y = 0, z = 0;
        bool ok = false;
        for(y = 2; y<=n; y++){
            for(z = y+1; z<=n; z++){
                if((xo[y]^xo[z])==n-1){
                    ok = true;
                    break;
                }
            }
            if(ok) break;
        }
        int axy, axz;
        cout<<"AND "<<x<<' '<<y<<endl;
        cout.flush();
        cin>>axy;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        int sxy, sxz, syz;
        sxy = xo[y] + 2*axy;
        sxz = xo[z] + 2*axz;
        syz = (n-1);
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,1,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=2){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y = 0, z = 0;
        bool ok = false;
        for(y = 2; y<=n; y++){
            for(z = y+1; z<=n; z++){
                if((xo[y]^xo[z])==n-1){
                    ok = true;
                    break;
                }
            }
            if(ok) break;
        }
        int axy, axz;
        cout<<"AND "<<x<<' '<<y<<endl;
        cout.flush();
        cin>>axy;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        int sxy, sxz, syz;
        sxy = xo[y] + 2*axy;
        sxz = xo[z] + 2*axz;
        syz = (n-1);
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,2,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=1){
            l = pos[i][0];
            r = pos[i][1];
            same = true;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y, z;
        rep(i,2,n){
            if(xo[i]==n-1){
                y = i;
                break;
            }
        }
        rep(i,2,n){
            if(i!=y){
                z = i;
                break;
            }
        }
        int axz, ayz;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        cout<<"AND "<<y<<' '<<z<<endl;
        cout.flush();
        cin>>ayz;
        int sxy, sxz, syz;
        sxy = xo[y];
        sxz = xo[z] + 2*axz;
        syz = (xo[y] ^ xo[z]) + 2*ayz;
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define NAME "Test"
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 998244353ll
#define ma 200005
#define bit(i) (i & (-i))
#define base 29
#define lli pair <ll, int>
#define pll pair <ll, ll>
#define INF 1e18
#define maxn ma*4
const string yno[2] = { "No\n", "Yes\n" };
const string yans[2] = {"Ashish\n", "Utkarsh\n"};
int ans[(1<<16) + 5];
int xo[(1<<16) + 5];

void process(){
    int n;
    cin>>n;
    rep(i,2,n){
        cout<<"XOR 1 "<<i<<endl;
        cout.flush();
        cin>>xo[i];
    }
    vector <int> pos[n+2];
    int l, r;
    bool same = 0;
    rep(i,2,n) pos[xo[i]].pb(i);
    rep(i,2,n){
        if(pos[i].size()>=0){
            l = pos[i][0];
            r = pos[i][1];
            same = i;
        }
    }
    if(same){
        cout<<"AND "<<l<<' '<<r<<endl;
        cout.flush();
        int tmp;
        cin>>tmp;
        ans[1] = tmp ^ xo[l];
        rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    }
    else{
        int x = 1, y, z;
        rep(i,2,n){
            if(xo[i]==n-1){
                y = i;
                break;
            }
        }
        rep(i,2,n){
            if(i!=y){
                z = i;
                break;
            }
        }
        int axz, ayz;
        cout<<"AND "<<x<<' '<<z<<endl;
        cout.flush();
        cin>>axz;
        cout<<"AND "<<y<<' '<<z<<endl;
        cout.flush();
        cin>>ayz;
        int sxy, sxz, syz;
        sxy = xo[y];
        sxz = xo[z] + 2*axz;
        syz = (xo[y] ^ xo[z]) + 2*ayz;
        ans[1] = (sxy + sxz - syz)/2;
    }
    rep(i,2,n) ans[i] = ans[i-1] ^ xo[i];
    cout<<"! ";
    rep(i,1,n) cout<<ans[i]<<' ';
    cout.flush();
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen(NAME".inp", "r", stdin);
//    freopen(NAME".out", "w", stdout);
//    int t;
//    cin>>t;
//    while(t--){
//        process();
//    }
	process();
	return 0;
}