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

const int maxn = 1 << 17;

void solve(){

    int n; cin >> n;
    int x = log2(n);
    int xr[n + 1], cnt[maxn];
    memset(cnt, 0, sizeof(cnt));
    bool duplicate = false;
    int val = -1;
    for(int i = 2; i <= n; ++i){
        cout << "XOR 1 " << i << '\n';
        cout.flush();
        cin >> xr[i];
        ++cnt[xr[i]];
        if(cnt[xr[i]] > 1){
            duplicate = true;
            val = xr[i];
        }
    }
    int a1 = 0;
    if(duplicate){//a[i] == a[j] => xr[i] == xr[j]
        int pos1 = -1, pos2 = -1;
        for(int i = 2; i <= n; ++i){
            if(xr[i] == val){
                pos1 = i;
                break;
            }
        }
        for(int i = n; i >= 2; --i){
            if(xr[i] == val){
                pos2 = i;
                break;
            }
        }
        cout << "AND " << pos1 + 1 << ' ' << pos2 + 1 << '\n';
        cout.flush();
        int x; cin >> x;
        a1 = x^xr[pos1];
    }
    else{//all the numbers from 0..n-1 are present => a lot of pairs xor = (n - 1)
        //if a[1] ^ a[i] = n - 1 = (2^k) - 1 => all bits different => a[1].a[i] = 0
        int pos1 = -1, pos2 = -1;
        for(int i = 2; i <= n; ++i){
            if(xr[i] == n - 1){
                pos1 = i;
                break;
            }
        }
        for(int i = 2; i <= n; ++i){
            if(pos1 != i){
                pos2 = i;
                break;
            }
        }
        int x = xr[pos1], y = xr[pos2];
        int a1a2 = 0, a1a3, a2a3;
        cout << "AND 1 " << pos2 << '\n';
        cout.flush();
        cin >> a1a3;
        cout << "AND " << pos1 << ' ' << pos2 << '\n';
        cout.flush();
        cin >> a2a3;
        for(int bit = 0; bit < x; ++bit){
            if(y >> bit & 1){//if a1 is diff from a3 => a2 and a3 are same
                if(!(a2a3 >> bit & 1)){
                    a1 |= (1 << bit);
                }
            }
            else{
                if(a1a3 >> bit & 1){
                    a1 |= (1 << bit);
                }
            }
        }
    }
    cout << "! " << a1;
    for(int i = 2; i <= n; ++i){
        cout << ' ' << (xr[i] ^ a1);
    }
    cout.flush();

}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false); cin.tie(0);

    int t = 1;
    // cin >> t;

    for(int i = 1; i <= t; i++){
        // cout << "Case #" << i << ": ";

        solve();

    }
    return 0;
}


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

const int maxn = 1 << 17;

void solve(){

    int n; cin >> n;
    int x = log2(n);
    int xr[n + 1], cnt[maxn];
    memset(cnt, 0, sizeof(cnt));
    bool duplicate = false;
    int val = -1;
    for(int i = 2; i <= n; ++i){
        cout << "XOR 1 " << i << '\n';
        cout.flush();
        cin >> xr[i];
        ++cnt[xr[i]];
        if(cnt[xr[i]] > 1){
            duplicate = true;
            val = xr[i];
        }
    }
    int a1 = 0;
    if(duplicate){//a[i] == a[j] => xr[i] == xr[j]
        int pos1 = -1, pos2 = -1;
        for(int i = 2; i <= n; ++i){
            if(xr[i] == val){
                pos1 = i;
                break;
            }
        }
        for(int i = n; i >= 2; --i){
            if(xr[i] == val){
                pos2 = i;
                break;
            }
        }
        cout << "AND " << pos1 << ' ' << pos2 << '\n';
        cout.flush();
        int x; cin >> x;
        a1 = x^xr[pos1];
    }
    else{//all the numbers from 0..n-1 are present => a lot of pairs xor = (n - 1)
        //if a[1] ^ a[i] = n - 1 = (2^k) - 1 => all bits different => a[1].a[i] = 0
        int pos1 = -1, pos2 = -1;
        for(int i = 2; i <= n; ++i){
            if(xr[i] == n - 1){
                pos1 = i;
                break;
            }
        }
        for(int i = 2; i <= n; ++i){
            if(pos1 != i){
                pos2 = i;
                break;
            }
        }
        int x = xr[pos1], y = xr[pos2];
        int a1a2 = 0, a1a3, a2a3;
        cout << "AND 1 " << pos2 << '\n';
        cout.flush();
        cin >> a1a3;
        cout << "AND " << pos1 << ' ' << pos2 << '\n';
        cout.flush();
        cin >> a2a3;
        for(int bit = 0; bit < x; ++bit){
            if(y >> bit & 1){//if a1 is diff from a3 => a2 and a3 are same
                if(!(a2a3 >> bit & 1)){
                    a1 |= (1 << bit);
                }
            }
            else{
                if(a1a3 >> bit & 1){
                    a1 |= (1 << bit);
                }
            }
        }
    }
    cout << "! " << a1;
    for(int i = 2; i <= n; ++i){
        cout << ' ' << (xr[i] ^ a1);
    }
    cout.flush();

}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false); cin.tie(0);

    int t = 1;
    // cin >> t;

    for(int i = 1; i <= t; i++){
        // cout << "Case #" << i << ": ";

        solve();

    }
    return 0;
}


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

#define all(v) v.begin(), v.end()
#define pi pair<ll, ll>
#define ll long long
#define ar array

const ll MOD = 998244353 ;
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};

//--------------------------------------------//
ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
//ll f[N];
//ll kCn(ll k, ll n) {if(k > n) return 0;  return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

const int N = 5005;

void test_case()
{
    int n;
    cin>>n;

    auto Ask = [](string s, int i, int j) {
        cout<<s<<" "<<i<<" "<<j<<endl;
    };

    vector<int> ans(n+1);
    vector<int> calxor(n+1);
    map<int, int> mp;
    bool repeated = 0;
    for(int i = 2; i <= n; ++i) {
        Ask("XOR", 1, i);
        cin>>calxor[i];
        if(mp.find(calxor[i]) != mp.end()) {
            Ask("AND", i, mp[calxor[i]]);
            cin>>ans[i];
            if(!ans[1])
                ans[1] = ans[i] ^ calxor[i];
            repeated =1;
        }
        mp[calxor[i]]=i;
    }

    if(repeated == 0) {
            int b,c;
        for(int i = 2; i <= n; ++i) {
            for(int j =i+1; j <= n; ++j) {
                if((calxor[i] ^ calxor[j]) == n-1) {
                    b=i;
                    c=j;
                }
            }
        }

        ans[1] = (calxor[b] + calxor[c] - (n - 1)) / 2;

    }

    for(int i = 2; i <= n; ++i) {
        ans[i] = ans[1] ^ calxor[i];
    }
    cout<<"! ";
    for(int i = 1; i <= n; ++i)
        cout<<ans[i]<<' ';
    cout<<endl;
}

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

        test_case();
    return 0;
}


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

#define all(v) v.begin(), v.end()
#define pi pair<ll, ll>
#define ll long long
#define ar array

const ll MOD = 998244353 ;
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};

//--------------------------------------------//
ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
//ll f[N];
//ll kCn(ll k, ll n) {if(k > n) return 0;  return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

const int N = 5005;

void test_case()
{
    int n;
    cin>>n;

    auto ask_and = [](int i, int j) {
        cout<<"AND "<<i<<" "<<j<<endl;
    };

    auto ask_or = [](int i, int j) {
        cout<<"OR "<<i<<" "<<j<<endl;
    };

    auto ask_xor = [](int i, int j) {
        cout<<"XOR "<<i<<" "<<j<<endl;
    };

    int a,b,c;
    ask_xor(1,2);
    cin>>a;
    ask_and(1,2);
    cin>>b;
    ask_and(2,3);
    cin>>c;

    int nbit = __builtin_popcount(n-1);

    vector<int> ans(n + 1);
    for(int i = 0; i <= nbit; ++i) {
        int bit1 = (a>>i)&1;
        int bit2 = (b>>i)&1;
        int bit3 = (c>>i)&1;
        if(bit1==0) {
            if(bit2==1) {
                ans[1] += (1<<i);
                ans[2] += (1<<i);
            }
        }
        else {
            if(bit3 == 1) {
                ans[2] += 1<<i;
            }
            else
                ans[1] += 1<<i;
        }
    }
    for(int i = 3; i <= n; ++i) {
        ask_xor(1, i);
        int x;
        cin>>x;
        ans[i] = x ^ ans[1];
    }
    cout<<"! ";
    for(int i = 1; i <= n; ++i)
        cout<<ans[i]<<' ';
    cout<<endl;
}

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

        test_case();
    return 0;
}


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

#define all(v) v.begin(), v.end()
#define pi pair<ll, ll>
#define ll long long
#define ar array

const ll MOD = 998244353 ;
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};

//--------------------------------------------//
ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
//ll f[N];
//ll kCn(ll k, ll n) {if(k > n) return 0;  return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

const int N = 5005;

void test_case()
{
    int n;
    cin>>n;

    auto ask_and = [](int i, int j) {
        cout<<"AND "<<i<<" "<<j<<endl;
    };

    auto ask_or = [](int i, int j) {
        cout<<"OR "<<i<<" "<<j<<endl;
    };

    auto ask_xor = [](int i, int j) {
        cout<<"XOR "<<i<<" "<<j<<endl;
    };

    int a,b,c;
    ask_xor(1,2);
    cin>>a;
    ask_and(1,2);
    cin>>b;
    ask_and(2,3);
    cin>>c;

    vector<int> ans(n + 1);
    for(int i = 0; i < (1 << n); ++i) {
        int bit1 = (a>>i)&1;
        int bit2 = (b>>i)&1;
        int bit3 = (c>>i)&1;
        if(bit1==0) {
            if(bit2==1) {
                ans[1] += (1<<i);
                ans[2] += (1<<i);
            }
        }
        else {
            if(bit3 == 1) {
                ans[2] += 1<<i;
            }
            else
                ans[1] += 1<<i;
        }
    }
    for(int i = 3; i <= n; ++i) {
        ask_xor(1, i);
        int x;
        cin>>x;
        ans[i] = x ^ ans[1];
    }
    cout<<"! ";
    for(int i = 1; i <= n; ++i)
        cout<<ans[i]<<' ';
    cout<<endl;
}

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

        test_case();
    return 0;
}


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

#define all(v) v.begin(), v.end()
#define pi pair<ll, ll>
#define ll long long
#define ar array

const ll MOD = 998244353 ;
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};

//--------------------------------------------//
ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
//ll f[N];
//ll kCn(ll k, ll n) {if(k > n) return 0;  return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

const int N = 5005;

void test_case()
{
    int n;
    cin>>n;

    auto ask_and = [](int i, int j) {
        cout<<"AND "<<i<<" "<<j<<endl;
    };

    auto ask_or = [](int i, int j) {
        cout<<"OR "<<i<<" "<<j<<endl;
    };

    auto ask_xor = [](int i, int j) {
        cout<<"XOR "<<i<<" "<<j<<endl;
    };

    int a,b,c;
    ask_xor(1, 2);
    cin>>a;
    ask_and(1,2);
    cin>>b;
    ask_and(2,3);
    cin>>c;

    vector<int> ans((1 << n) + 1);
    for(int i = 0; i < (1 << n); ++i) {
        int bit1 = (a>>i)&1;
        int bit2 = (b>>i)&1;
        int bit3 = (c>>i)&1;
        if(bit1==0) {
            if(bit2==1) {
                ans[1] += (1<<i);
                ans[2] += (1<<i);
            }
        }
        else {
            if(bit3 == 1) {
                ans[2] += 1<<i;
            }
            else
                ans[1] += 1<<i;
        }
    }
    for(int i = 3; i <= (1 << n); ++i) {
        ask_xor(1, i);
        int x;
        cin>>x;
        ans[i] = x ^ ans[1];
    }
    cout<<"! ";
    for(int i = 1; i <= (1<<n); ++i)
        cout<<ans[i]<<' ';
    cout<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--)
        test_case();
    return 0;
}


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

#define all(v) v.begin(), v.end()
#define pi pair<ll, ll>
#define ll long long
#define ar array

const ll MOD = 998244353 ;
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};

//--------------------------------------------//
ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
//ll f[N];
//ll kCn(ll k, ll n) {if(k > n) return 0;  return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

const int N = 5005;

void test_case()
{
    int n;
    cin>>n;

    auto Ask = [](string s, int i, int j) {
        cout<<s<<" "<<i<<" "<<j<<endl;
    };

    vector<int> ans(n+1);
    vector<int> calxor(n+1);
    map<int, int> mp;
    bool repeated = 0;
    bool first = 1;
    for(int i = 2; i <= n; ++i) {
        Ask("XOR", 1, i);
        cin>>calxor[i];
        if(mp.find(calxor[i]) != mp.end()) {
            if(first) {
                Ask("AND", i, mp[calxor[i]]);
                cin>>ans[i];
                ans[1] = ans[i] ^ calxor[i];
                repeated =1;
                first =0;
            }
        }
        mp[calxor[i]]=i;
    }

    if(repeated == 0) {
            int b,c;
        for(int i = 2; i <= n; ++i) {
            for(int j =i+1; j <= n; ++j) {
                if((calxor[i] ^ calxor[j]) == n-1) {
                    b=i;
                    c=j;
                }
            }
        }
        int x, y;
        Ask("AND", 1, b);
        cin>>x;
        Ask("AND", 1, c);
        cin>>y;
        ans[1] = (calxor[b] + calxor[c] + 2 * x + 2 * y - (n - 1)) / 2;

    }

    for(int i = 2; i <= n; ++i) {
        ans[i] = ans[1] ^ calxor[i];
    }
    cout<<"! ";
    for(int i = 1; i <= n; ++i)
        cout<<ans[i]<<' ';
    cout<<endl;
}

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

        test_case();
    return 0;
}


// 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
*/


// 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 = 2;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                if (i != n)
                    var3 = i + 1;
            }
        }
        int x = a[1], y, z;
        cout << "AND 1 " << var3 << endl;
        int tt;
        cin >> tt;
        y = a[var3] + 2 * tt;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt;
        z = (var2 ^ var3) + 2 * (tt);
        ans[1] = (x + y - z) / 2;
        cout << "! ";
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        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])) {
            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 x,y,t ;
			t = xors[n - 1];
			if (t == 2){
				cout << "AND 3 1" << endl;
				cin >> x;
				cout << "AND 3 2" << endl;
				cin >> y;
				t = x | y;
				a[1] = t ^ a[3];
			}
			else{
				cout << "AND 2 1" << endl;
				cin >> x;
				cout << "AND 2 " << t << endl;
				cin >> y;
				t = x | y;
				a[1] = t ^ a[2];
			}
	        cout << "! ";
 	       l00p(i, 1, n + 1) {
	            ans[i] = (a[i] ^ ans[1]);
 	       }
	        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])) {
            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 = a[var2], y, z;
        cout << "AND 1 " << var3 << endl;
        int tt;
        cin >> tt;
        y = a[var3] + 2 * tt;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt;
        z = (a[var2] ^ a[var3]) + 2 * (tt);
        ans[1] = (x + y - z) / 2;
        cout << "! ";
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        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[i])
        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
*/


// 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];
        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;
    vl a(n + 1);
    map<ll, ll> xors;
    bool flag = false;
    ll 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;
    }
    vl 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 {
        ll var2=-1, var3=-1;
        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;
            }
        }
        ll x, y, z=a[var2];
        ll tt1;
        ll tt2;
        cout << "AND 1 " << var3 << endl;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        l00p(i, 2, n + 1) {
            ans[i] = (ans[1] ^ a[i]);
        }
        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<ll, ll> xors;
    bool flag = false;
    ll 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;
    }
    vl 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 {
        ll var2=-1, var3=-1;
        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;
            }
        }
        ll x, y, z=a[var2];
        ll tt1;
        ll tt2;
        cout << "AND 1 " << var3 << endl;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        l00p(i, 2, n + 1) {
            ans[i] = (ans[1] ^ a[i]);
        }
        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;
    vl a(n + 1);
    map<ll, ll> xors;
    bool flag = false;
    ll ind1, ind2;
    a[1] = 0;
    xors[0] = 1;
    for (int i = 2; i <= n; i++) {
        cout << "XOR 1 " << i << endl;
        cin >> a[i];
        if (xors.count(a[i]) && !flag) {
            flag = true;
            ind1 = xors[a[i]];
            ind2 = i;
        }
        xors[a[i]] = i;
    }
    vl ans(n + 1);
    if (flag) {
        cout << "AND " << ind1 << " " << ind2 << endl;
        cin >> ans[ind1];
        ans[1] = (a[ind1] ^ ans[ind1]);
        for (int i = 1; i <= n; i++) {
            ans[i] = (ans[1] ^ a[i]);
        }
    }
    else {
        ll var2 = -1, var3 = -1;
        for (int i = 2; i <= n; i++) {
            if (a[i] == n - 1) {
                var2 = i;
                break;
            }
        }
        for (int i = 2; i <= n; i++) {
            if (a[i] != n - 1) {
                var3 = i;
                break;
            }
        }
        ll x, y, z = a[var2];
        ll tt1;
        ll tt2;
        cout << "AND 1 " << var3 << endl;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        for (int i = 2; i <= n; i++) {
            ans[i] = (ans[1] ^ a[i]);
        }
    }
    cout << "! ";
    for (int i = 1; i <= n; i++) {
        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])) {
            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 = 2;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                if (i != n)
                    var3 = i + 1;
            }
        }
        int x=a[var2], y, z;
        cout << "AND 1 " << var3 << endl;
        int tt;
        cin >> tt;
        y = a[var3] + 2 * tt;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt;
        z = (a[var2] ^ a[var3]) + 2 * (tt);
        ans[1] = (x + y - z) / 2;
        cout << "! ";
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        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])) {
            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 = 2;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                if (i != n)
                    var3 = i + 1;
            }
        }
        int x=a[var2], y, z;
        cout << "AND 1 " << var3 << endl;
        int tt;
        cin >> tt;
        y = a[var3] + 2 * tt;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt;
        z = (a[var2] ^ a[var3]) + 2 * (tt);
        ans[1] = (x + y - z) / 2;
        cout << "! ";
        l00p(i, 1, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        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])) {
            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 = 2;
        l00p(i, 2, n + 1) {
            if (a[i] == n - 1) {
                var2 = i;
                if (i != n)
                    var3 = i + 1;
            }
        }
        int x=a[var2], y, z;
        cout << "AND 1 " << var3 << endl;
        int tt;
        cin >> tt;
        y = a[var3] + 2 * tt;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt;
        z = (var2 ^ var3) + 2 * (tt);
        ans[1] = (x + y - z) / 2;
        cout << "! ";
        l00p(i, 2, n + 1) {
            ans[i] = (a[i] ^ ans[1]);
        }
        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[ind1]);
        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
*/


// 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;
    vl a(n + 1);
    map<ll, ll> xors;
    bool flag = false;
    ll ind1, ind2;
    a[1] = 0;
    xors[0] = 1;
    for (int i = 2; i <= n; i++) {
        cout << "XOR 1 " << i << endl;
        cin >> a[i];
        if (xors.count(a[i]) && !flag) {
            flag = true;
            ind1 = xors[a[i]];
            ind2 = i;
        }
        xors[a[i]] = i;
    }
    vl ans(n + 1);
    if (flag) {
        cout << "AND " << ind1 << " " << ind2 << endl;
        cin >> ans[ind1];
        for (int i = 1; i <= n; i++) {
            ans[i] = (ans[ind1] ^ a[i]);
        }
        cout << "! ";
        for (int i = 1; i <= n; i++) {
            cout << ans[i] << " ";
        }
    }
    else {
        ll var2 = -1, var3 = -1;
        for (int i = 2; i <= n; i++) {
            if (a[i] == n - 1) {
                var2 = i;
                break;
            }
        }
        for (int i = 2; i <= n; i++) {
            if (a[i] != n - 1) {
                var3 = i;
                break;
            }
        }
        ll x, y, z = a[var2];
        ll tt1;
        ll tt2;
        cout << "AND 1 " << var3 << endl;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        for (int i = 2; i <= n; i++) {
            ans[i] = (ans[1] ^ a[i]);
        }
        cout << "! ";
        for (int i = 1; i <= n; i++) {
            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])) {
            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 x,y,t ;
			t = xors[n - 1];
			if (t == 2){
				cout << "AND 3 1" << endl;
				cin >> x;
				cout << "AND 3 2" << endl;
				cin >> y;
				t = x | y;
				ans[1] = t ^ a[3];
			}
			else{
				cout << "AND 2 1" << endl;
				cin >> x;
				cout << "AND 2 " << t << endl;
				cin >> y;
				t = x | y;
				ans[1] = t ^ a[2];
			}
	        cout << "! ";
 	       l00p(i, 2, n + 1) {
	            ans[i] = (a[i] ^ ans[1]);
 	       }
	        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;
    vl a(n + 1);
    map<ll, ll> xors;
    bool flag = false;
    ll ind1, ind2;
    a[1] = 0;
    xors[0] = 1;
    for (int i = 2; i <= n; i++) {
        cout << "XOR 1 " << i << endl;
        cin >> a[i];
        if (xors.count(a[i]) && !flag) {
            flag = true;
            ind1 = xors[a[i]];
            ind2 = i;
        }
        xors[a[i]] = i;
    }
    vl ans(n + 1);
    if (flag) {
        cout << "AND " << ind1 << " " << ind2 << endl;
        cin >> ans[ind1];
        ans[1] = (a[ind1] ^ ans[ind1]);
        for (int i = 1; i <= n; i++) {
            ans[i] = (ans[1] ^ a[i]);
        }
        cout << "! ";
        for (int i = 1; i <= n; i++) {
            cout << ans[i] << " ";
        }
    }
    else {
        ll var2 = -1, var3 = -1;
        for (int i = 2; i <= n; i++) {
            if (a[i] == n - 1) {
                var2 = i;
                break;
            }
        }
        for (int i = 2; i <= n; i++) {
            if (a[i] != n - 1) {
                var3 = i;
                break;
            }
        }
        ll x, y, z = a[var2];
        ll tt1;
        ll tt2;
        cout << "AND 1 " << var3 << endl;
        cin >> tt1;
        x = a[var3] + 2 * tt1;
        cout << "AND " << var2 << " " << var3 << endl;
        cin >> tt2;
        y = (a[var2] ^ a[var3]) + 2 * (tt2);
        ans[1] = (x - y + z) / 2;
        for (int i = 2; i <= n; i++) {
            ans[i] = (ans[1] ^ a[i]);
        }
        cout << "! ";
        for (int i = 1; i <= n; i++) {
            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
*/