#include<bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define M1 (ll)1000000007
#define M2 (ll)998244353
#define Pi 3.141592653
#define exp 2.71828
#define ll long long
#define ull unsigned long long
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define di deque<int>
#define dl deque<ll>
#define dii deque<pi>
#define dll deque<pl>
#define vvi vector<vi>
#define vvl vector<vl>
#define vii vector<pi>
#define vll vector<pl>
#define pb push_back
#define pp pop_back
#define pf push_front
#define pt pop_front
#define mp make_pair
#define in insert
#define er erase
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define rp(i,a,b) for(int i=a;i<b;i++)
#define rpt(i,a,b,t) for(int i=a;i<b&&t<1;i++)
#define rep(i,n) for(int i = 0 ; i<n ; i++)
#define rept(i,n,t) for(int i = 0 ; i<n&&t<1 ; i++)
#define repr(i,n) for(int i = n-1 ; i>=0 ; i--)
#define reprt(i,n,t) for(int i=n-1;i>=0&&t<1;i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define SORT(v) sort(v.begin(),v.end())
ll arr[] = {0,0,2,3,1,7,5,0} ;
ll check(ll x , ll y){
    return arr[x]&arr[y] ;
}
ll check1(ll x, ll y){
    return arr[x]^arr[y] ;
}
ll compute(ll a, ll ind , ll bits){
    cout << "XOR 1 " << ind+1 << endl ;
    ll x = 0 , tempx = 0 , tempa = 0 , ret = 0 ;
    cin >> x ;
    //x = check1(0, ind) ;
    for(ll i = 0 ; i < bits ; i++){
        tempx = x >> i ;
        tempa = a >> i ;
        if(tempx&1)
            ret += (ll)pow(2, i)*((ll)(!(tempa&1))) ;
        else ret += (ll)pow(2, i)*((ll)(tempa&1)) ;
    }
    return ret ;
}
void solve(){
	ll n = 0 , axb = 0 , bxc = 0 , axc = 0 , ab = 0 , bc = 0 , ac = 0, asb = 0 , bsc = 0 , asc = 0 , bits = 0 ;
    cin >> n ;
    ll a[n] ;
    pl temp ;
    cout << "AND 1 2" << endl ;
    cin >> ab ;
    cout << "AND 2 3" << endl ;
    cin >> bc ;
    cout << "AND 1 3" << endl ;
    cin >> ac ;
    cout << "XOR 1 2" << endl ;
    cin >> axb ;
    cout << "XOR 2 3" << endl ;
    cin >> bxc ;
    //ab = check(0,1) , bc = check(1,2) , ac = check(0,2) , axb = check1(0,1) , bxc = check1(1,2) ;
    axc = axb^bxc ;
    asb = axb + 2*(ab) ;
    bsc = bxc + 2*(bc) ;
    asc = axc + 2*(ac) ;
    bits = log(n)/log(2) ;
    a[0] = (asb-bsc+asc)/2 , a[1] = (bsc-asc+asb)/2 , a[2] = (asc-asb+bsc)/2 ;
    for(int i = 3 ; i < n ; i ++)
        a[i] = compute(a[0], i , bits) ;
    cout << "! " ;
    for(ll i = 0 ; i < n ; i++)
        cout << a[i] << " " ;
    cout << endl ;
}
int main(){
	ll T = 1 ;
	//cin >> T ;
	while(T--)
		solve() ;
}


#include<bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define M1 (ll)1000000007
#define M2 (ll)998244353
#define Pi 3.141592653
#define exp 2.71828
#define ll long long
#define ull unsigned long long
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define di deque<int>
#define dl deque<ll>
#define dii deque<pi>
#define dll deque<pl>
#define vvi vector<vi>
#define vvl vector<vl>
#define vii vector<pi>
#define vll vector<pl>
#define pb push_back
#define pp pop_back
#define pf push_front
#define pt pop_front
#define mp make_pair
#define in insert
#define er erase
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define rp(i,a,b) for(int i=a;i<b;i++)
#define rpt(i,a,b,t) for(int i=a;i<b&&t<1;i++)
#define rep(i,n) for(int i = 0 ; i<n ; i++)
#define rept(i,n,t) for(int i = 0 ; i<n&&t<1 ; i++)
#define repr(i,n) for(int i = n-1 ; i>=0 ; i--)
#define reprt(i,n,t) for(int i=n-1;i>=0&&t<1;i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define SORT(v) sort(v.begin(),v.end())
ll arr[] = {0,0,2,3,1,7,5,0} ;
ll check(ll x , ll y){
    return arr[x]&arr[y] ;
}
ll check1(ll x, ll y){
    return arr[x]^arr[y] ;
}
void solve(){
	ll n = 0 , axb = 0 , bxc = 0 , axc = 0 , ab = 0 , bc = 0 , ac = 0, asb = 0 , bsc = 0 , asc = 0 , temp = 0 ;
    cin >> n ;
    ll a[n] ;
    cout << "AND 1 2" << endl ;
    cin >> ab ;
    cout << "AND 2 3" << endl ;
    cin >> bc ;
    cout << "AND 1 3" << endl ;
    cin >> ac ;
    cout << "XOR 1 2" << endl ;
    cin >> axb ;
    cout << "XOR 2 3" << endl ;
    cin >> bxc ;
    //ab = check(0,1) , bc = check(1,2) , ac = check(0,2) , axb = check1(0,1) , bxc = check1(1,2) ;
    axc = axb^bxc ;
    asb = axb + 2*(ab) ;
    bsc = bxc + 2*(bc) ;
    asc = axc + 2*(ac) ;
    a[0] = (asb-bsc+asc)/2 , a[1] = (bsc-asc+asb)/2 , a[2] = (asc-asb+bsc)/2 ;
    for(int i = 3 ; i < n ; i ++){
        cout << "XOR 1 " << i+1 << endl ;
        cin >> temp ;
        a[i] = temp^a[0] ;
    }
    cout << "! " ;
    for(ll i = 0 ; i < n ; i++)
        cout << a[i] << " " ;
    cout << endl ;
}
int main(){
	ll T = 1 ;
	//cin >> T ;
	while(T--)
		solve() ;
}


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if (v+1 == n) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (a == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = allones;
        if (a == 1) b = 2;
        else b = 1;
        a0 = query("AND", 0, a);
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if (v+1 == n) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (a == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = allones;
        if (a == 1) b = 2;
        else b = 1;
        a0 = 0;
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if (v+1 == (1<<n)) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (a == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = allones;
        if (a == 1) b = 2;
        else b = 1;
        a0 = 0;
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    //    if (~a) {
    //        if (a == 0 || b == 0) {
    //
    //        } else {
    //            a0 = b0 = query("AND", 0, a);
    //            ab = query("AND", a, b);
    //        }
    //    } else {
    //
    //    }

    a = 1, b = 2;
    a0 = query("AND", 0, a);
    b0 = query("AND", 0, b);
    ab = query("AND", a, b);

    int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;

    arr[0] = x / 2;

    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    //    if (~a) {
    //        if (a == 0 || b == 0) {
    //
    //        } else {
    //            a0 = b0 = query("AND", 0, a);
    //            ab = query("AND", a, b);
    //        }
    //    } else {
    //
    //    }

    a = 1, b = 2;
    a0 = query("AND", 0, a);
    b0 = query("AND", 0, b);
    ab = query("AND", a, b);

    int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b] + 2 * ab);

    arr[0] = x / 2;

    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if (v+1 == n) allones = i;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (a == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = allones;
        if (a == 1) b = 2;
        else b = 1;
        a0 = 0;
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            a = 1, b = 2;
            a0 = query("AND", 0, a);
            b0 = query("AND", 0, b);
            ab = query("AND", a, b);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = allones;
        if (a == 1) b = 2;
        else b = 1;
        a0 = 0;
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }

    int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;

    arr[0] = x / 2;

    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (a == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
//        a = allones;
//        if (a == 1) b = 2;
//        else b = 1;
//        a0 = 0;
//        b0 = query("AND", 0, b);
//        ab = query("AND", a, b);
        a = 1, b = 2;
        a0 = query("AND", 0, a);
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i+1, j+1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }
    int a0, b0, ab;
//    if (~a) {
//        if (a == 0 || b == 0) {
//
//        } else {
//            a0 = b0 = query("AND", 0, a);
//            ab = query("AND", a, b);
//        }
//    } else {
//
//    }
    a = 1, b = 2;
    a0 = query("AND", 0, a);
    b0 = query("AND", 0, b);
    ab = query("AND", a, b);

    int x = xorWith[a] + xorWith[b] +
            xorWith[a] ^xorWith[b] +
                        2 * a0 + 2 * b0 - 2 * ab;

    arr[0] = x / 2;

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            a = 1, b = 2;
            a0 = query("AND", 0, a);
            b0 = query("AND", 0, b);
            ab = query("AND", a, b);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
        a = 1, b = 2;
        a0 = query("AND", 0, a);
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
//        a = allones;
//        if (a == 1) b = 2;
//        else b = 1;
//        a0 = 0;
//        b0 = query("AND", 0, b);
//        ab = query("AND", a, b);
    }

    int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;

    arr[0] = x / 2;

    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i+1, j+1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }
    int a0, b0, ab;
//    if (~a) {
//        if (a == 0 || b == 0) {
//
//        } else {
//            a0 = b0 = query("AND", 0, a);
//            ab = query("AND", a, b);
//        }
//    } else {
//
//    }
    a = 1, b = 2;
    a0 = query("AND", 0, a);
    b0 = query("AND", 0, b);
    ab = query("AND", a, b);

    int x = xorWith[a] + xorWith[b] -
            xorWith[a] ^xorWith[b] +
                        2 * a0 + 2 * b0 - 2 * ab;

    arr[0] = x / 2;

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


#include <bits/stdc++.h>

#define endl '\n'

using namespace std;
typedef long long ll;
const int N = 1e5 + 7, M = 2 * N;

int query(const char *q, int i, int j) {
    printf("%s %d %d\n", q, i + 1, j + 1);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    if (!~v) exit(0);
    return v;
}
int xorWith[N];
int vis[N];
int arr[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef CLION
    //freopen("in", "rt", stdin);
#endif
    int n;
    scanf("%d", &n);
    memset(vis, -1, n * sizeof vis[0]);
    memset(arr, -1, n * sizeof arr[0]);

    xorWith[vis[0] = 0] = 0;
    int a = -1, b = -1;
    int allones = -1;
    for (int i = 1; i < n; ++i) {
        int v = query("XOR", 0, i);
        if (~vis[v]) a = vis[v], b = i;
        if ((v & (v + 1)) == 0) allones = v;
        xorWith[vis[v] = i] = v;
    }

    int a0, b0, ab;

    if (~a) {
        if (a == 0 || b == 0) {
            if (b == 0) swap(a, b);
            arr[0] = query("AND", 0, a);
        } else {
            a0 = b0 = query("AND", 0, a);
            ab = query("AND", a, b);
        }
    } else {
//        a = allones;
//        if (a == 1) b = 2;
//        else b = 1;
//        a0 = 0;
//        b0 = query("AND", 0, b);
//        ab = query("AND", a, b);
        a = 1, b = 2;
        a0 = query("AND", 0, a);
        b0 = query("AND", 0, b);
        ab = query("AND", a, b);
    }
    if (!~arr[0]) {
        int x = xorWith[a] + 2 * a0 + xorWith[b] + 2 * b0 - (xorWith[a] ^ xorWith[b]) - 2 * ab;
        arr[0] = x / 2;
    }
    for (int i = 1; i < n; ++i) {
        arr[i] = arr[0] ^ xorWith[i];
    }

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


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 2; j <= n; ++j) {
        cout << "XOR 1 " << j << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j - 1);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << *begin(zero_indices) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index - 1] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = n - 1;
        for (ll i = 2; i < n; ++i) {
            if (xors[i] == (~xors[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << i1 << endl << flush;
        cin >> x1;
        cout << "AND 1 " << i2 << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << *begin(p.second) << " " << *rbegin(p.second) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 1; j < n; ++j) {
        cout << "XOR 1 " << (j + 1) << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << (*begin(zero_indices) + 1) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = n - 1;
        if (xors[i1] == mask) {
            i1 = 2;
        }
        for (ll i = 2; i < n; ++i) {
            if (xors[i] == (~xors[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << (i1 + 1) << endl << flush;
        cin >> x1;
        cout << "AND 1 " << (i2 + 1) << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << (*begin(p.second) + 1) << " " << (*rbegin(p.second) + 1) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 1; j < n; ++j) {
        cout << "XOR 1 " << (j + 1) << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << (*begin(zero_indices) + 1) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = n - 1;
        for (ll i = 2; i < n; ++i) {
            if (xors[i] == (~xors[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << (i1 + 1) << endl << flush;
        cin >> x1;
        cout << "AND 1 " << (i2 + 1) << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << (*begin(p.second) + 1) << " " << (*rbegin(p.second) + 1) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 2; j <= n; ++j) {
        cout << "XOR 1 " << j << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j - 1);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << *begin(zero_indices) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index - 1] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = n - 1;
        for (ll i = 2; i < n; ++i) {
            if (xors[i] == (~xors[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << (i1 + 1) << endl << flush;
        cin >> x1;
        cout << "AND 1 " << (i2 + 1) << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << *begin(p.second) << " " << *rbegin(p.second) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 2; j <= n; ++j) {
        cout << "XOR 1 " << j << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j - 1);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << *begin(zero_indices) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index - 1] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = n - 1;
        for (ll i = 2; i < n; ++i) {
            if (v[i] == (~v[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << i1 << endl << flush;
        cin >> x1;
        cout << "AND 1 " << i2 << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << *begin(p.second) << " " << *rbegin(p.second) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


// set vim: fdm=marker sw=4 ts=4 et

#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <bits/stdc++.h>

using namespace std;

typedef int_fast64_t ll;
// const ll modulo = 1000000007;

#ifndef countof
#define countof(x) (sizeof(x) / sizeof(*(x)))
#endif

// --------------------------------------------------------------------------------

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

    ll n;
    cin >> n;

    vector<ll> v(n, -1);

    vector<ll> xors;
    xors.reserve(n);
    xors.push_back(0);

    set<ll> zero_indices;
    map<ll, set<ll>> m;

    for (ll j = 2; j <= n; ++j) {
        cout << "XOR 1 " << j << endl << flush;
        ll x;
        cin >> x;
        xors.push_back(x);
        if (!x) {
            zero_indices.insert(j);
        }
        m[x].insert(j - 1);
    }

    if (!zero_indices.empty()) {
        cout << "AND 1 " << *begin(zero_indices) << endl << flush;
        ll x;
        cin >> x;
        v[0] = x;
        for (auto zero_index : zero_indices) {
            v[zero_index - 1] = x;
        }
    }
    else if (static_cast<ll>(m.size()) == n - 1) {
        // all values are different and there's no zero in it

        ll i1 = 1;
        ll i2 = -1;
        ll mask = (1 << n) - 1;
        for (ll i = 2; i < n; ++i) {
            if (v[i] == (~v[i1] & mask)) {
                i2 = i;
                break;
            }
        }
        assert(i2 != -1);

        ll x1, x2;
        cout << "AND 1 " << i1 << endl << flush;
        cin >> x1;
        cout << "AND 1 " << i2 << endl << flush;
        cin >> x2;

        v[0] = (~xors[i1] & x1) | (~xors[i2] & x2);
    }
    else {
        // there's at least one duplicate

        for (const auto& p : m) {
            if (p.second.size() > 1) {
                cout << "AND " << *begin(p.second) << " " << *rbegin(p.second) << endl << flush;
                ll x;
                cin >> x;
                for (auto i : p.second) {
                    v[i] = x;
                }

                if (p.first) {
                    v[0] = x ^ p.first;
                }
                else {
                    assert(*begin(p.second) == 0);
                }
                break;
            }
        }
    }

    for (ll i = 1; i < n; ++i) {
        if (v[i] == -1) {
            v[i] = xors[i] ^ v[0];
        }
    }

    cout << "! ";
    copy(begin(v), end(v), ostream_iterator<ll>(cout, " "));
    cout << endl;

    return 0;
}

// --------------------------------------------------------------------------------


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  //ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  ll q=0;
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;

    ll x;
    cin>>x;
    a[i]=x;
    q++;
  }
  cout<<"OR "<<"1"<<" "<<"2"<<endl;

  ll x1;
  cin>>x1;
  q++;
  cout<<"OR "<<"2"<<" "<<"3"<<endl;

  ll y;
  cin>>y;
  q++;
  cout<<"OR "<<"1"<<" "<<"3"<<endl;

  ll z;
  cin>>z;
  q++;
  assert(q==n+2);
  ll bit[30];
  for(ll i=0;i<30;i++){
    bit[i]=0;
  }
  ll three=0;
  for(ll i=0;i<30;i++){
    if(x1&(1<<i))bit[i]++;
    if(y&(1<<i))bit[i]++;
    if(z&(1<<i))bit[i]++;
    if(bit[i]==2){
        three=three|(1ll<<i);
    }
  }
  ll sum=(a[1]^a[3]);
  sum=ll(sum^three);
  vector<ll>ans(n+1,0);
  ans[4]=sum;
  for(ll i=5;i<=n;i++){
    ans[i]=ll(ans[i-1]^a[i-1]);
  }
  for(ll i=3;i>=1;i--){
    ans[i]=ll(ans[i+1]^a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int getAND(int i, int j) {
	int x;
	cout << "AND " << i << " " << j << endl;
	cin >> x;
	return x;
}

int getOR(int i, int j) {
	int x;
	cout << "OR " << i << " " << j << endl;
	cin >> x;
	return x;
}

int getXOR(int i, int j) {
	int x;
	cout << "XOR " << i << " " << j << endl;
	cin >> x;
	return x;
}
int main(){
    int n; cin >> n;
	int aANDb = getAND(1, 2);
	int bANDc = getAND(2, 3);
	int aANDc = getAND(1, 3);
	int aXORb = getXOR(1, 2);
	int bXORc = getXOR(2, 3);
	int aXORc = aXORb ^ bXORc;

	int ab = 2 * aANDb + aXORb;
	int bc = 2 * bANDc + bXORc;
	int ac = 2 * aANDc + aXORc;

	int a = (ab + ac - bc) / 2;
	int b = ab - a;
	int c = ac - a;

	vector<int> res = { a, b, c };
	for (int i = 4; i <= n; i++) {
		int xr = getXOR(1, i);
		res.push_back(a ^ xr);
	}

	cout << "! ";
	for (auto r : res) {
		cout << r << " ";
	} cout << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  //ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  ll x;
  cin>>x;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  ll y;
  cin>>y;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  ll z;
  cin>>z;
  ll bit[20]={0};
  ll last_3=0;
  for(ll i=0;i<20;i++){
    ll p=(1ll<<i);
    if(x&p)bit[i]++;
    if(y&p)bit[i]++;
    if(z&p)bit[i]++;
    if(bit[i]==2){
        last_3+=p;
    }
  }
  ll xo=a[n-1]^a[n-3];
  xo^=last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=xo;
  for(ll i=n-2;i<=n;i++){
    ans[i]=(ans[i-1]^a[i-1]);
  }
  for(ll i=n-4;i>=1;i--){
    ans[i]=(ans[i+1])^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  //ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  ll q=0;
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    cout.flush();
    ll x;
    cin>>x;
    a[i]=x;
    q++;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  cout.flush();
  ll x1;
  cin>>x1;
  q++;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  cout.flush();
  ll y;
  cin>>y;
  q++;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  cout.flush();
  ll z;
  cin>>z;
  q++;
  assert(q==n+2);
  ll bit[30];
  for(ll i=0;i<30;i++){
    bit[i]=0;
  }
  ll last_3=0;
  for(ll i=0;i<30;i++){
    if(x1&(1<<i))bit[i]++;
    if(y&(1<<i))bit[i]++;
    if(z&(1<<i))bit[i]++;
    if(bit[i]==2){
        last_3+=(1ll<<i);
    }
  }
  ll sum=(a[n-1]^a[n-3]);
  sum=sum^last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=sum;
  ans[n-2]=(a[n-3]^ans[n-3]);
  ans[n-1]=(a[n-2]^ans[n-2]);
  ans[n]=(a[n-1]^ans[n-1]);
  for(ll i=n-4;i>=1;i--){
    ans[i]=(ans[i+1])^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  //ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  ll x;
  cin>>x;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  ll y;
  cin>>y;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  ll z;
  cin>>z;
  ll bit[30]={0};
  ll last_3=0;
  for(ll i=0;i<30;i++){
    ll p=(1ll<<i);
    if(x&p)bit[i]++;
    if(y&p)bit[i]++;
    if(z&p)bit[i]++;
    if(bit[i]==2){
        last_3+=p;
    }
  }
  ll xo=a[n-1]^a[n-3];
  xo^=last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=xo;
  for(ll i=n-2;i<=n;i++){
    ans[i]=ans[i-1]^a[i-1];
  }
  for(ll i=n-4;i>=1;i--){
    ans[i]=ans[i+1]^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  ll x;
  cin>>x;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  ll y;
  cin>>y;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  ll z;
  cin>>z;
  ll bit[20]={0};
  ll last_3=0;
  for(ll i=0;i<20;i++){
    ll p=(1ll<<i);
    if(x&p)bit[i]++;
    if(y&p)bit[i]++;
    if(z&p)bit[i]++;
    if(bit[i]==2){
        last_3+=p;
    }
  }
  ll xo=a[n-1]^a[n-3];
  xo^=last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=xo;
  for(ll i=n-2;i<=n;i++){
    ans[i]=(ans[i-1]^a[i-1]);
  }
  for(ll i=n-4;i>=1;i--){
    ans[i]=(ans[i+1])^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  //ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  ll x;
  cin>>x;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  ll y;
  cin>>y;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  ll z;
  cin>>z;
  ll bit[20]={0};
  ll last_3=0;
  for(ll i=0;i<16;i++){
    ll p=(1ll<<i);
    if(x&p)bit[i]++;
    if(y&p)bit[i]++;
    if(z&p)bit[i]++;
    if(bit[i]==2){
        last_3|=p;
    }
  }
  ll xo=a[n-1]^a[n-3]^last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=xo;
  for(ll i=n-2;i<=n;i++){
    ans[i]=(ans[i-1]^a[i-1]);
  }
  for(ll i=n-4;i>=1;i--){
    ans[i]=(ans[i+1])^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  ios_base::sync_with_stdio(false),cin.tie(NULL);
  ll n;
  cin>>n;
  ll a[n+1]={0};
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
  }
  cout<<"OR "<<n-2<<" "<<n-1<<endl;
  ll x;
  cin>>x;
  cout<<"OR "<<n-1<<" "<<n<<endl;
  ll y;
  cin>>y;
  cout<<"OR "<<n-2<<" "<<n<<endl;
  ll z;
  cin>>z;
  ll bit[20]={0};
  ll last_3=0;
  for(ll i=0;i<20;i++){
    ll p=(1ll<<i);
    if(x&p)bit[i]++;
    if(y&p)bit[i]++;
    if(z&p)bit[i]++;
    if(bit[i]==2){
        last_3+=p;
    }
  }
  ll xo=a[n-1]^a[n-3];
  xo^=last_3;
  vector<ll>ans(n+1,0);
  ans[n-3]=xo;
  for(ll i=n-2;i<=n;i++){
    ans[i]=ans[i-1]^a[i-1];
  }
  for(ll i=n-4;i>=1;i--){
    ans[i]=ans[i+1]^(a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"
int main(){
  ll n;
  cin>>n;
  ll a[n+1]={0};
  ll q=0;
  for(ll i=1;i<=n-1;i++){
    cout<<"XOR "<<i<<" "<<i+1<<endl;
    ll x;
    cin>>x;
    a[i]=x;
    q++;
  }
  cout<<"OR "<<"1"<<" "<<"2"<<endl;

  ll x1;
  cin>>x1;
  q++;
  cout<<"OR "<<"2"<<" "<<"3"<<endl;

  ll y;
  cin>>y;
  q++;
  cout<<"OR "<<"1"<<" "<<"3"<<endl;

  ll z;
  cin>>z;
  q++;
  assert(q==n+2);
  ll bit[30];
  for(ll i=0;i<30;i++){
    bit[i]=0;
  }
  ll three=0;
  for(ll i=0;i<30;i++){
    if(x1&(1ll<<i))bit[i]++;
    if(y&(1ll<<i))bit[i]++;
    if(z&(1ll<<i))bit[i]++;
    if(bit[i]==2){
        three=three|(1ll<<i);
    }
    if((1ll<<i)>n)break;
  }
  ll sum=(a[1]^a[3]);
  sum=ll(sum^three);
  vector<ll>ans(n+1,0);
  ans[4]=sum;
  for(ll i=5;i<=n;i++){
    ans[i]=ll(ans[i-1]^a[i-1]);
  }
  for(ll i=3;i>=1;i--){
    ans[i]=ll(ans[i+1]^a[i]);
  }
  cout<<"! ";
  for(ll i=1;i<=n;i++)cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


#include <bits/stdc++.h>
#define ll        long long int
#define ld        long double
#define pi        pair<int,int>
#define all(x)    x.begin(), x.end()
#define allr(x)   x.rbegin(), x.rend()
#define sz(x)     ((int)x.size())
#define ln(x)     ((int)x.length())
#define mp        make_pair
#define pb        push_back
#define ff        first
#define ss        second
#define endl      '\n'
#define dbg(x)    cout << #x << ": " << x << endl
#define clr(x,v)  memset(x, v, sizeof(x))
#define fix(x)    cout << setprecision(x) << fixed;
#define FASTIO    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ll inf = 1LL << 30;
const int MAXN = 1e5 + 5;

void cp()
{
    int n, a, b, c;
    cin >> n;
    cout << "OR 1 2\n";
    cout.flush();
    cin >> a;
    cout << "AND 1 2\n";
    cout.flush();
    cin >> b;
    cout << "XOR 1 2\n";
    cout.flush();
    cin >> c;
    int first = 0, second = 0;
    for(int i = 0; i < (1 << n); i++)
    {
        int j = c ^ i;
        if((i | j) == a && (i & j) == b)
            first = i, second = j, cout << i << " " << j << endl;
    }

    vector<int> arr(n);
    arr[0] = first, arr[1] = second;
    for(int i = 2; i < n; i++)
    {
        cout << "XOR " << 1 << " " << i + 1 << endl;
        cout.flush();
        int x;
        cin >> x;
        arr[i] = x ^ first;
    }
    cout << "! ";
    for(int i = 0; i < n; i++)
    {
        cout << arr[i];
        if(i + 1 < n)
            cout << " ";
    }
    cout << endl;
    cout.flush();
}

int main()
{
    // FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll        long long int
#define ld        long double
#define pi        pair<int,int>
#define all(x)    x.begin(), x.end()
#define allr(x)   x.rbegin(), x.rend()
#define sz(x)     ((int)x.size())
#define ln(x)     ((int)x.length())
#define mp        make_pair
#define pb        push_back
#define ff        first
#define ss        second
#define endl      '\n'
#define dbg(x)    cout << #x << ": " << x << endl
#define clr(x,v)  memset(x, v, sizeof(x))
#define fix(x)    cout << setprecision(x) << fixed;
#define FASTIO    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ll inf = 1LL << 30;
const int MAXN = 1e5 + 5;

int AND(int i, int j)
{
    cout << "AND " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}

int OR(int i, int j)
{
    cout << "OR " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}

int XOR(int i, int j)
{
    cout << "XOR " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}
// 14 - 1110
// 2  - 0010
// 5  - 0101
void cp()
{
    int n;
    cin >> n;
    int xor13 = XOR(1, 3);
    int and13 = AND(1, 3);
    int sum13 = xor13 + and13 * 2;
    int xor23 = XOR(2, 3);
    int and23 = AND(2, 3);
    int sum23 = xor23 + and23 * 2;
    int xor12 = xor13 ^ xor23;
    int and12 = AND(1, 2);
    int sum12 = xor12 + and12 * 2;
    // 0 1 2 3
    vector<int> arr(n);
    for(int i = 0; i < n; i++)
    {
        int j = xor12 ^ i;
        int k = xor13 ^ i;
        if(i + j == sum12 && i + k == sum13 && j + k == sum23)
            arr[0] = i, arr[1] = j, arr[2] = k;
    }
    for(int i = 3; i < n; i++)
    {
        int x = XOR(1, i + 1);
        arr[i] = x ^ arr[0];
    }
    cout << "! ";
    for(int x : arr)
        cout << x << " ";
    cout << endl;
    cout.flush();
}

int main()
{
    // FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll        long long int
#define ld        long double
#define pi        pair<int,int>
#define all(x)    x.begin(), x.end()
#define allr(x)   x.rbegin(), x.rend()
#define sz(x)     ((int)x.size())
#define ln(x)     ((int)x.length())
#define mp        make_pair
#define pb        push_back
#define ff        first
#define ss        second
#define endl      '\n'
#define dbg(x)    cout << #x << ": " << x << endl
#define clr(x,v)  memset(x, v, sizeof(x))
#define fix(x)    cout << setprecision(x) << fixed;
#define FASTIO    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ll inf = 1LL << 30;
const int MAXN = 1e5 + 5;

int AND(int i, int j)
{
    cout << "AND " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}

int OR(int i, int j)
{
    cout << "OR " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}

int XOR(int i, int j)
{
    cout << "XOR " << i << " " << j << endl;
    cout.flush();
    int x;
    cin >> x;
    if(x == -1)
        exit(0);
    return x;
}

void cp()
{
    int n;
    cin >> n;
    int xor13 = XOR(1, 3);
    int and13 = AND(1, 3);
    int sum13 = xor13 + and13 * 2;
    int xor23 = XOR(2, 3);
    int and23 = AND(2, 3);
    int sum23 = xor23 + and23 * 2;
    int xor12 = xor13 ^ xor23;
    int and12 = AND(1, 2);
    int sum12 = xor12 + and12 * 2;

    vector<int> arr(n);
    for(int i = 0; i < n; i++)
    {
        int j = xor12 ^ i;
        int k = xor13 ^ i;
        if(i + j == sum12 && i + k == sum13 && j + k == sum23)
            arr[0] = i, arr[1] = j, arr[2] = k;
    }
    for(int i = 3; i < n; i++)
    {
        int x = XOR(1, i + 1);
        arr[i] = x ^ arr[0];
    }
    cout << "! ";
    for(int x : arr)
        cout << x << " ";
    cout << endl;
    cout.flush();
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll        long long int
#define ld        long double
#define pi        pair<int,int>
#define all(x)    x.begin(), x.end()
#define allr(x)   x.rbegin(), x.rend()
#define sz(x)     ((int)x.size())
#define ln(x)     ((int)x.length())
#define mp        make_pair
#define pb        push_back
#define ff        first
#define ss        second
#define endl      '\n'
#define dbg(x)    cout << #x << ": " << x << endl
#define clr(x,v)  memset(x, v, sizeof(x))
#define fix(x)    cout << setprecision(x) << fixed;
#define FASTIO    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ll inf = 1LL << 30;
const int MAXN = 1e5 + 5;

void cp()
{
    int n, a, b, c;
    cin >> n;
    cout << "OR 1 2\n";
    cout.flush();
    cin >> a;
    cout << "AND 1 2\n";
    cout.flush();
    cin >> b;
    cout << "XOR 1 2\n";
    cout.flush();
    cin >> c;
    int first = 0, second = 0;
    for(int i = 0; i < (1 << n); i++)
    {
        int j = c ^ i;
        if((i | j) == a && (i & j) == b)
            first = i, second = j, cout << i << " " << j << endl;
    }

    vector<int> arr(n);
    arr[0] = first, arr[1] = second;
    for(int i = 2; i < n; i++)
    {
        cout << "XOR " << 1 << " " << i + 1 << endl;
        cout.flush();
        int x;
        cin >> x;
        arr[i] = x ^ first;
    }
    cout << "! ";
    for(int x : arr)
        cout << x << " ";
    cout.flush();
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll        long long int
#define ld        long double
#define pi        pair<int,int>
#define all(x)    x.begin(), x.end()
#define allr(x)   x.rbegin(), x.rend()
#define sz(x)     ((int)x.size())
#define ln(x)     ((int)x.length())
#define mp        make_pair
#define pb        push_back
#define ff        first
#define ss        second
#define endl      '\n'
#define dbg(x)    cout << #x << ": " << x << endl
#define clr(x,v)  memset(x, v, sizeof(x))
#define fix(x)    cout << setprecision(x) << fixed;
#define FASTIO    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ll inf = 1LL << 30;
const int MAXN = 1e5 + 5;

void cp()
{
    int n, a, b, c;
    cin >> n;
    cout << "OR 1 2\n";
    cout.flush();
    cin >> a;
    cout << "AND 1 2\n";
    cout.flush();
    cin >> b;
    cout << "XOR 1 2\n";
    cout.flush();
    cin >> c;
    int first = 0, second = 0;
    for(int i = 0; i < (1 << n); i++)
    {
        int j = c ^ i;
        if((i | j) == a && (i & j) == b)
            first = i, second = j;
    }

    vector<int> arr(n);
    arr[0] = first, arr[1] = second;
    for(int i = 2; i < n; i++)
    {
        cout << "XOR " << 1 << " " << i + 1 << endl;
        cout.flush();
        int x;
        cin >> x;
        arr[i] = x ^ first;
    }
    cout << "! ";
    for(int i = 0; i < n; i++)
    {
        cout << arr[i];
        if(i + 1 < n)
            cout << " ";
    }
    cout << endl;
    cout.flush();
}

int main()
{
    // FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}

ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}

int main() {
	ll n;
	cin >> n;
	ll x;
	cout << "AND " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> x;
	ll y;
	cout << "XOR " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> y;

	ll z;
	cout << "XOR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> z;

	ll a;
	cout << "OR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> a;

	ll b;
	cout << "OR " << 2 << " " << 3 << "\n";
	cout << endl;
	cin >> b;

	ll c = 0;
	for (int i = 0; i < 16; i++) {
		ll m = (1LL << i);
		if ((x & m)) {
			if ((z & m));
			else
				c += m;
		}
		else if ((y & m)) {
			if ((a & m) && (b & m))
				c += m;
		}
		else {
			if ((a & m) && (b & m))
				c += m;
		}
	}
	vl v(n, 0);
	v[2] = c;
	for (int i = 3; i < n; i++) {
		ll cur;
		cout << "XOR " << 3 << " " << i + 1 << "\n";
		cout << endl;
		cin >> cur;
		for (int j = 0; j < 16; j++) {
			ll m = (1LL << j);
			if (c & m) {
				if (cur & m);
				else
					v[i] += m;
			}
			else {
				if (cur & m)
					v[i] += m;
			}
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (c & m) {
			if (z & m);
			else
				v[0] += m;
		}
		else {
			if (z & m)
				v[0] += m;
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (v[0] & m) {
			if (y & m);
			else
				v[1] += m;
		}
		else {
			if (v[0] & m)
				v[1] += m;
		}
	}
	cout << "! ";
	for (auto i : v)
		cout << i << " ";
	cout << "\n";
}


#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}

ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}

int main() {
	ll n;
	cin >> n;
	ll x;
	cout << "AND " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> x;
	ll y;
	cout << "XOR " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> y;

	ll z;
	cout << "XOR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> z;

	ll a;
	cout << "OR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> a;

	ll b;
	cout << "OR " << 2 << " " << 3 << "\n";
	cout << endl;
	cin >> b;

	ll c = 0;
	for (int i = 0; i < 16; i++) {
		ll m = (1LL << i);
		if ((x & m)) {
			if ((z & m));
			else
				c += m;
		}
		else if ((y & m)) {
			if ((a & m) && (b & m))
				c += m;
		}
		else {
			if ((a & m) || (b & m))
				c += m;
		}
	}
	vl v(n, 0);
	v[2] = c;
	for (int i = 3; i < n; i++) {
		ll cur;
		cout << "XOR " << 3 << " " << i + 1 << "\n";
		cout << endl;
		cin >> cur;
		for (int j = 0; j < 16; j++) {
			ll m = (1LL << j);
			if (c & m) {
				if (cur & m);
				else
					v[i] += m;
			}
			else {
				if (cur & m)
					v[i] += m;
			}
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (c & m) {
			if (z & m);
			else
				v[0] += m;
		}
		else {
			if (z & m)
				v[0] += m;
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (v[0] & m) {
			if (y & m);
			else
				v[1] += m;
		}
		else {
			if (y & m)
				v[1] += m;
		}
	}
	cout << "! ";
	for (auto i : v)
		cout << i << " ";
	cout << "\n";
}


#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}

ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}

int main() {
	ll n;
	cin >> n;
	vl x(n);
	x[0] = 0;
	set <ll> s;
	s.insert(0);
	for (ll i = 1; i < n; i++) {
		cout << "XOR 1 " << i + 1 << "\n";
		cout << endl;
		ll cur;
		cin >> cur;
		x[i] = cur;
		s.insert(cur);
	}
	vl v(n, 0);
	if (s.size() < n) {
		vector<pair<ll, ll>> las(n, { -1, -1});
		ll it, j;
		for (ll ii = 0; ii < n; ii++) {
			//cout << x[i] << " " << las[x[i]].ff << " " << las[x[i]].ss << "\n";
			if (las[x[ii]].ff != -1) {
				it = las[x[ii]].ss;
				j = ii;
				break;
			}
			las[x[ii]].ff = 1;
			las[x[ii]].ss = ii;
		}
		cout << "AND " << it + 1 << " " << j + 1 << "\n";
		cout << endl;
		ll cur;
		cin >> cur;
		v[it] = cur;
		//v[i] = cur;
		//v[j] = cur;
		if (it != 0) {
			for (ll i = 0; i < 16; i++) {
				ll m = (1LL << i);
				if (x[it]&m) {
					if (v[it]&m);
					else
						v[0] += m;
				}
				else {
					if (v[it]&m)
						v[0] += m;
				}
			}
		}
		for (ll i = 1; i < n; i++) {
			if (i == it)
				continue;
			for (ll j = 0; j < 16; j++) {
				ll m = (1LL << j);
				if (x[i]&m) {
					if (v[0]&m);
					else
						v[i] += m;
				}
				else {
					if (v[0]&m)
						v[i] += m;
				}
			}
		}
		cout << "! ";
		for (auto i : v)
			cout << i << " ";
		cout << "\n";
	}
	else {

		//cout << "haha\n";
		//ll y = x[1] ^ x[2];
		//assert(y == yy);
		/*ll z;
		z = x[1];*/
		ll p, q;
		p = 1;
		for (ll i = 0; i < n; i++) {
			if ((x[i]^x[1]) == n - 1) {
				q = i;
				break;
			}
		}
		if (q == 0) {
			p = 2;
			for (ll i = 0; i < n; i++) {
				if ((x[i]^x[p]) == n - 1) {
					q = i;
					break;
				}
			}
		}
		ll a;
		cout << "OR " << p + 1 << " " << 1 << "\n";
		cout << endl;
		cin >> a;

		ll b;
		cout << "OR " << q + 1 << " " << 1 << "\n";
		cout << endl;
		cin >> b;
		ll y = x[p] ^ x[q];
		ll z = x[p];
		ll xx = 0;

		ll c = 0;
		for (int i = 0; i < 16; i++) {
			ll m = (1LL << i);
			if ((xx & m)) {
				if ((z & m));
				else
					c += m;
			}
			else if ((y & m)) {
				if ((a & m) && (b & m))
					c += m;
			}
			else {
				if ((a & m) || (b & m))
					c += m;
			}
		}
		//vl v(n, 0);
		v[0] = c;
		for (int i = 1; i < n; i++) {
			ll cur;
			cur = x[i];
			for (int j = 0; j < 16; j++) {
				ll m = (1LL << j);
				if (c & m) {
					if (cur & m);
					else
						v[i] += m;
				}
				else {
					if (cur & m)
						v[i] += m;
				}
			}
		}
		cout << "! ";
		for (auto i : v)
			cout << i << " ";
		cout << "\n";
	}

}


#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}

ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}

int main() {
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
	ll n;
	cin >> n;
	ll x;
	cout << "AND " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> x;
	ll y;
	cout << "XOR " << 1 << " " << 2 << "\n";
	cout << endl;
	cin >> y;

	ll z;
	cout << "XOR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> z;

	ll a;
	cout << "OR " << 1 << " " << 3 << "\n";
	cout << endl;
	cin >> a;

	ll b;
	cout << "OR " << 2 << " " << 3 << "\n";
	cout << endl;
	cin >> b;

	ll c = 0;
	for (int i = 0; i < 16; i++) {
		ll m = (1LL << i);
		if ((x & m)) {
			if ((z & m));
			else
				c += m;
		}
		else if ((y & m)) {
			if ((a & m) && (b & m))
				c += m;
		}
		else {
			if ((a & m) && (b & m))
				c += m;
		}
	}
	vl v(n, 0);
	v[2] = c;
	for (int i = 3; i < n; i++) {
		ll cur;
		cout << "XOR " << 3 << " " << i + 1 << "\n";
		cout << endl;
		cin >> cur;
		for (int j = 0; j < 16; j++) {
			ll m = (1LL << j);
			if (c & m) {
				if (cur & m);
				else
					v[i] += m;
			}
			else {
				if (cur & m)
					v[i] += m;
			}
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (c & m) {
			if (z & m);
			else
				v[0] += m;
		}
		else {
			if (z & m)
				v[0] += m;
		}
	}
	for (int j = 0; j < 16; j++) {
		ll m = (1LL << j);
		if (a & m) {
			if (y & m);
			else
				v[1] += m;
		}
		else {
			if (y & m)
				v[1] += m;
		}
	}
	cout << "! ";
	for (auto i : v)
		cout << i << " ";
	cout << "\n";
}


// Premature optimization is the root of all evil in programming - Knuth.

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)

ll gcd(ll a, ll b){

	if(b==0){

	   return a;
	}

	return gcd(b, a%b);

}

 ll ncr(ll x, ll y){
 	ll ans=1;

 	y=(y > x-y? x-y: y);

 	for(ll i=0; i<y; i++){

 		ans=ans*(x-i);

 		ans=ans/(i+1);

 		ans=ans%mod;
 	}

 	return ans;
 }

ll power(ll x, ll y){

    ll ans=1;

    while(y){

        if(y&1){

            ans=ans*x;

            ans=ans%mod;

        }

        x=x*x;

        x=x%mod;

        y=y>>1;
    }

    return ans;

}

void solve(){

	ll n; cin>>n;

	cout<<"XOR 1 2"<<endl;

	ll x12; cin>>x12;

	cout<<"AND 1 2"<<endl;

	ll a12; cin>>a12;

	cout<<"XOR 1 3"<<endl;

	ll x13; cin>>x13;

	cout<<"AND 1 3"<<endl;

	ll a13; cin>>a13;

	cout<<"AND 2 3"<<endl;

	ll a23; cin>>a23;

	ll x23=x13^x12;

	ll bcsum=x23+2*a23;

	ll bcdiff=abs(x12+2*a12-x13-2*a13);

	ll b=(bcsum-bcdiff)/2,c=bcsum-b,a=x12^b;

	vector<ll> vec(n);

	vec[0]=a;vec[1]=b;vec[2]=c;

	for(int i=4; i<=n; i++){
		cout<<"XOR 1 "<<i<<endl;
		ll h23; cin>>h23;
		ll res1=h23^vec[0];
		vec[i-1]=res1;
	}

	cout<<"! ";

	for(int i=0; i<n; i++){
		cout<<vec[i]<<" ";
	}cout<<endl;

	cout<<"! ";

	cout<<vec[0]<<" "<<vec[2]<<" "<<vec[1]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    	cout<<"! ";

	cout<<vec[1]<<" "<<vec[0]<<" "<<vec[2]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

   	cout<<vec[1]<<" "<<vec[2]<<" "<<vec[0]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    cout<<vec[2]<<" "<<vec[0]<<" "<<vec[1]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    cout<<vec[2]<<" "<<vec[1]<<" "<<vec[0]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

   return ;

}

int main(){

    // ios_base::sync_with_stdio(0);

    // cin.tie(0);

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

    // clock_t begin, end;

    // double time_spent;

    // begin = clock(); // Time taken till now.

    while(t--){

	  solve();

    }

   //end= clock(); // Total  Time taken till now.

   //time_spent= (end- begin) / CLOCKS_PER_SEC;

   //cout<<time_spent<<"\n";

	return 0;
}


// Premature optimization is the root of all evil in programming - Knuth.

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)

ll gcd(ll a, ll b){

	if(b==0){

	   return a;
	}

	return gcd(b, a%b);

}

 ll ncr(ll x, ll y){
 	ll ans=1;

 	y=(y > x-y? x-y: y);

 	for(ll i=0; i<y; i++){

 		ans=ans*(x-i);

 		ans=ans/(i+1);

 		ans=ans%mod;
 	}

 	return ans;
 }

ll power(ll x, ll y){

    ll ans=1;

    while(y){

        if(y&1){

            ans=ans*x;

            ans=ans%mod;

        }

        x=x*x;

        x=x%mod;

        y=y>>1;
    }

    return ans;

}

void solve(){

	ll n; cin>>n;

	cout<<"XOR 1 2"<<endl;

	ll x; cin>>x;

	cout<<"OR 1 2"<<endl;

	ll o; cin>>o;

    cout<<"AND 1 2"<<endl;

	ll a; cin>>a;

	ll sum=2*a+x;

	ll tra=63,curr=0;

	ll x1=x,a1=a,ans=0;

	while(tra--){

		ll d1=x1%2,d2=a1%2;

		ll h=(d1|2)&(d2);

		if(h==1){
			ans=ans+1LL<<curr;
		}

		x1=x1>>1; a1=a1>>1;

	}

   ll fi=ans,se=x^fi;

   vector<ll> vec;

   vec.push_back(fi); vec.push_back(se);

   for(int i=3; i<=n; i++){

   	   cout<<"XOR 1 "<<i<<endl;

   	   ll in; cin>>in;

   	   ll ele=fi^in;

   	   vec.push_back(ele);

   }

   cout<<"! ";

   for(auto it: vec){
   	 cout<<it<<" ";
   }cout<<endl;

   cout<<"! ";

   cout<<vec[1]<<" "<<vec[0]<<" ";

   for(int i=2; i<vec.size(); i++){
   	  cout<<vec[i]<<" ";
   }cout<<endl;

   return ;

}

int main(){

    // ios_base::sync_with_stdio(0);

    // cin.tie(0);

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

    // clock_t begin, end;

    // double time_spent;

    // begin = clock(); // Time taken till now.

    while(t--){

	  solve();

    }

   //end= clock(); // Total  Time taken till now.

   //time_spent= (end- begin) / CLOCKS_PER_SEC;

   //cout<<time_spent<<"\n";

	return 0;
}


// Premature optimization is the root of all evil in programming - Knuth.

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)

ll gcd(ll a, ll b){

	if(b==0){

	   return a;
	}

	return gcd(b, a%b);

}

 ll ncr(ll x, ll y){
 	ll ans=1;

 	y=(y > x-y? x-y: y);

 	for(ll i=0; i<y; i++){

 		ans=ans*(x-i);

 		ans=ans/(i+1);

 		ans=ans%mod;
 	}

 	return ans;
 }

ll power(ll x, ll y){

    ll ans=1;

    while(y){

        if(y&1){

            ans=ans*x;

            ans=ans%mod;

        }

        x=x*x;

        x=x%mod;

        y=y>>1;
    }

    return ans;

}

void solve(){

	ll n; cin>>n;

	cout<<"XOR 1 2"<<endl;

	ll x; cin>>x;

	cout<<"OR 1 2"<<endl;

	ll o; cin>>o;

    cout<<"AND 1 2"<<endl;

	ll a; cin>>a;

	ll sum=2*a+x;

	ll tra=63,curr=0;

	ll x1=x,a1=a,ans=0;

	while(tra--){

		ll d1=x1%2,d2=a1%2;

		ll h=(d1|2)&(d2);

		if(h==1){
			ans=ans+1LL<<curr;
		}

		x1=x1>>1; a1=a1>>1;

	}

   ll fi=ans,se=x^fi;

   vector<ll> vec;

   vec.push_back(fi); vec.push_back(se);

   for(int i=3; i<=n; i++){

   	   cout<<"XOR 1 "<<i<<endl;

   	   ll in; cin>>in;

   	   ll ele=fi^in;

   	   vec.push_back(ele);

   }

   cout<<"! ";

    cout<<vec[1]<<" "<<vec[0]<<" ";

   for(int i=2; i<vec.size(); i++){
   	  cout<<vec[i]<<" ";
   }cout<<endl;

   cout<<"! ";

    for(auto it: vec){
   	 cout<<it<<" ";
   }cout<<endl;

   return ;

}

int main(){

    // ios_base::sync_with_stdio(0);

    // cin.tie(0);

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

    // clock_t begin, end;

    // double time_spent;

    // begin = clock(); // Time taken till now.

    while(t--){

	  solve();

    }

   //end= clock(); // Total  Time taken till now.

   //time_spent= (end- begin) / CLOCKS_PER_SEC;

   //cout<<time_spent<<"\n";

	return 0;
}


// Premature optimization is the root of all evil in programming - Knuth.

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)

ll gcd(ll a, ll b){

	if(b==0){

	   return a;
	}

	return gcd(b, a%b);

}

 ll ncr(ll x, ll y){
 	ll ans=1;

 	y=(y > x-y? x-y: y);

 	for(ll i=0; i<y; i++){

 		ans=ans*(x-i);

 		ans=ans/(i+1);

 		ans=ans%mod;
 	}

 	return ans;
 }

ll power(ll x, ll y){

    ll ans=1;

    while(y){

        if(y&1){

            ans=ans*x;

            ans=ans%mod;

        }

        x=x*x;

        x=x%mod;

        y=y>>1;
    }

    return ans;

}

void solve(){

	ll n; cin>>n;

	cout<<"XOR 1 2"<<endl;

	ll x12; cin>>x12;

	cout<<"AND 1 2"<<endl;

	ll a12; cin>>a12;

	cout<<"XOR 1 3"<<endl;

	ll x13; cin>>x13;

	cout<<"AND 1 3"<<endl;

	ll a13; cin>>a13;

	cout<<"AND 2 3"<<endl;

	ll a23; cin>>a23;

	ll x23=x13^x12;

	ll bcsum=x23+2*a23;

	ll bcdiff=(x12+2*a12-x13-2*a13);

	ll b=(bcsum+bcdiff)/2,c=bcsum-b,a=x12^b;

	vector<ll> vec(n);

	vec[0]=a;vec[1]=b;vec[2]=c;

	for(int i=4; i<=n; i++){
		cout<<"XOR 1 "<<i<<endl;
		ll h23; cin>>h23;
		ll res1=h23^vec[0];
		vec[i-1]=res1;
	}

	cout<<"! ";

	for(int i=0; i<n; i++){
		cout<<vec[i]<<" ";
	}cout<<endl;

	cout<<"! ";

	cout<<vec[0]<<" "<<vec[2]<<" "<<vec[1]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    	cout<<"! ";

	cout<<vec[1]<<" "<<vec[0]<<" "<<vec[2]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

   	cout<<vec[1]<<" "<<vec[2]<<" "<<vec[0]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    cout<<vec[2]<<" "<<vec[0]<<" "<<vec[1]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

    cout<<vec[2]<<" "<<vec[1]<<" "<<vec[0]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

   return ;

}

int main(){

    // ios_base::sync_with_stdio(0);

    // cin.tie(0);

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

    // clock_t begin, end;

    // double time_spent;

    // begin = clock(); // Time taken till now.

    while(t--){

	  solve();

    }

   //end= clock(); // Total  Time taken till now.

   //time_spent= (end- begin) / CLOCKS_PER_SEC;

   //cout<<time_spent<<"\n";

	return 0;
}


// Premature optimization is the root of all evil in programming - Knuth.

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define mod (int) (1e9+7)

ll gcd(ll a, ll b){

	if(b==0){

	   return a;
	}

	return gcd(b, a%b);

}

 ll ncr(ll x, ll y){
 	ll ans=1;

 	y=(y > x-y? x-y: y);

 	for(ll i=0; i<y; i++){

 		ans=ans*(x-i);

 		ans=ans/(i+1);

 		ans=ans%mod;
 	}

 	return ans;
 }

ll power(ll x, ll y){

    ll ans=1;

    while(y){

        if(y&1){

            ans=ans*x;

            ans=ans%mod;

        }

        x=x*x;

        x=x%mod;

        y=y>>1;
    }

    return ans;

}

void solve(){

	ll n; cin>>n;

	cout<<"XOR 1 2"<<endl;

	ll x12; cin>>x12;

	cout<<"AND 1 2"<<endl;

	ll a12; cin>>a12;

	cout<<"XOR 1 3"<<endl;

	ll x13; cin>>x13;

	cout<<"AND 1 3"<<endl;

	ll a13; cin>>a13;

	cout<<"AND 2 3"<<endl;

	ll a23; cin>>a23;

	ll x23=x13^x12;

	ll bcsum=x23+2*a23;

	ll bcdiff=abs(x12+2*a12-x13-2*a13);

	ll b=(bcsum-bcdiff)/2,c=bcsum-b,a=x12^b;

	vector<ll> vec(n);

	vec[0]=a;vec[1]=b;vec[2]=c;

	for(int i=4; i<=n; i++){
		cout<<"XOR 1 "<<i<<endl;
		ll h23; cin>>h23;
		ll res1=h23^vec[0];
		vec[i-1]=res1;
	}

	cout<<"! ";

	for(int i=0; i<n; i++){
		cout<<vec[i]<<" ";
	}cout<<endl;

	cout<<"! ";

	cout<<vec[0]<<" "<<vec[2]<<" "<<vec[1]<<" ";

	for(int i=3; i<n; i++){
		cout<<vec[i]<<" ";
	}

    cout<<endl;

   return ;

}

int main(){

    // ios_base::sync_with_stdio(0);

    // cin.tie(0);

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

    // clock_t begin, end;

    // double time_spent;

    // begin = clock(); // Time taken till now.

    while(t--){

	  solve();

    }

   //end= clock(); // Total  Time taken till now.

   //time_spent= (end- begin) / CLOCKS_PER_SEC;

   //cout<<time_spent<<"\n";

	return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define _itr ::iterator
#define forn(i, x, y) for (ll i = x; i < y; ++i)
#define ford(i, x, y) for (ll i = x; i > y; --i)
#define forne(i, x, y) for (ll i = x; i <= y; ++i)
#define forde(i, x, y) for (ll i = x; i >= y; --i)
#define rd(x) cin >> x; cin.ignore();
#define rdstr(x) getline(cin, x);
#define rdarr(x, y) for (ll i = 0; i < y; ++i) cin >> x[i];
#define rdmtr(x, y, z) for (ll i = 0; i < y; ++i) for (ll j = 0; j < z; ++j) cin >> x[i][j];
#define pb push_back

#define X first
#define Y second

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const ll MaxN = 1e6 + 7;
const ll MaxM = 5e3 + 7;
const ll MDL = 1e9 + 7;
const ll INF = 1e15 + 7;

typedef pair<ll, ll> pi;
typedef pair<pi, ll> pii;
typedef vector<ll> vi;
typedef ll arr[MaxN];

ll REPIT = 1;

const bool MQ = false;

ll n, m;
ll res[MaxN];
ll a12, a13, a23, x12, x13, x23;

ll bit(ll s, ll k)
{
    return ((s & (1 << k)) == (1 << k));
}

void Solve()
{
    cin >> n;
    cout << "AND 1 2" << endl; cin >> a12;
        if (a12 == -1) return;
    cout << "AND 1 3" << endl; cin >> a13;
        if (a13 == -1) return;
    cout << "AND 2 3" << endl; cin >> a23;
        if (a23 == -1) return;
    cout << "XOR 1 3" << endl; cin >> x13;
        if (x13 == -1) return;
    cout << "XOR 2 3" << endl; cin >> x23;
        if (x23 == -1) return;
    x12 = x13 ^ x23;
    ll s12 = x12 + 2 * a12, s13 = x13 + 2 *a13, s23 = x23 + 2 * a23;
    ll s = (s12 + s23 + s13) / 2;
    res[0] = s - s23;
    res[1] = s - s13;
    res[2] = s - s12;
    forn(i, 3, n)
    {
        cout << "XOR " << 1 << ' ' << i + 1 << endl;
        ll x; cin >> x;
        if (x == -1) return;
        for (ll j = 1, a = 0; j < n; j *= 2, ++a)
        {
            ll bx = bit(x, a);
            if (!bx) res[i] += (bit(res[0], a) << a);
            else res[i] += ((1 - bit(res[0], a)) << a);
        }
    }
    cout << "!"; forn(i, 0, n) cout << ' ' << res[i];
    cout << flush;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    if (MQ == true)
    {
        cin >> REPIT;
    }
    while (REPIT--) Solve();
    cout.flush();
    #ifdef OFFLINE
    fclose(stdin);
    #endif
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define _itr ::iterator
#define forn(i, x, y) for (ll i = x; i < y; ++i)
#define ford(i, x, y) for (ll i = x; i > y; --i)
#define forne(i, x, y) for (ll i = x; i <= y; ++i)
#define forde(i, x, y) for (ll i = x; i >= y; --i)
#define rd(x) cin >> x; cin.ignore();
#define rdstr(x) getline(cin, x);
#define rdarr(x, y) for (ll i = 0; i < y; ++i) cin >> x[i];
#define rdmtr(x, y, z) for (ll i = 0; i < y; ++i) for (ll j = 0; j < z; ++j) cin >> x[i][j];
#define pb push_back

#define X first
#define Y second

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const ll MaxN = 1e6 + 7;
const ll MaxM = 5e3 + 7;
const ll MDL = 1e9 + 7;
const ll INF = 1e15 + 7;

typedef pair<ll, ll> pi;
typedef pair<pi, ll> pii;
typedef vector<ll> vi;
typedef ll arr[MaxN];

ll REPIT = 1;

const bool MQ = false;

ll n, m;
ll res[MaxN];
ll a12, a13, a23, x12, x13, x23;

ll bit(ll s, ll k)
{
    return ((s & (1 << k)) == (1 << k));
}

void Solve()
{
    cin >> n;
    cout << "AND 1 2" << endl; cin >> a12;
    cout << "AND 1 3" << endl; cin >> a13;
    cout << "AND 2 3" << endl; cin >> a23;
    cout << "XOR 1 3" << endl; cin >> x13;
    cout << "XOR 2 3" << endl; cin >> x23;
    x12 = x13 ^ x23;
    ll s12 = x12 + 2 * a12, s13 = x13 + 2 *a13, s23 = x23 + 2 * a23;
    ll s = (s12 + s23 + s13) / 2;
    res[0] = s - s23;
    res[1] = s - s13;
    res[2] = s - s12;
    forn(i, 3, n)
    {
        cout << "XOR " << 1 << ' ' << i + 1 << endl;
        ll x; cin >> x;
        for (ll j = 1, a = 0; j < n; j *= 2, ++a)
        {
            ll bx = bit(x, a);
            if (!bx) res[i] += (bit(res[0], a) << a);
            else res[i] += ((1 - bit(res[0], a)) << a);
        }
    }
    cout << "!"; forn(i, 0, n) cout << ' ' << res[i];
    cout << flush;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    if (MQ == true)
    {
        cin >> REPIT;
    }
    while (REPIT--) Solve();
    cout.flush();
    #ifdef OFFLINE
    fclose(stdin);
    #endif
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define _itr ::iterator
#define forn(i, x, y) for (ll i = x; i < y; ++i)
#define ford(i, x, y) for (ll i = x; i > y; --i)
#define forne(i, x, y) for (ll i = x; i <= y; ++i)
#define forde(i, x, y) for (ll i = x; i >= y; --i)
#define rd(x) cin >> x; cin.ignore();
#define rdstr(x) getline(cin, x);
#define rdarr(x, y) for (ll i = 0; i < y; ++i) cin >> x[i];
#define rdmtr(x, y, z) for (ll i = 0; i < y; ++i) for (ll j = 0; j < z; ++j) cin >> x[i][j];
#define pb push_back

#define X first
#define Y second

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const ll MaxN = 1e6 + 7;
const ll MaxM = 5e3 + 7;
const ll MDL = 1e9 + 7;
const ll INF = 1e15 + 7;

typedef pair<ll, ll> pi;
typedef pair<pi, ll> pii;
typedef vector<ll> vi;
typedef ll arr[MaxN];

ll REPIT = 1;

const bool MQ = false;

ll n, m;
ll res[MaxN];
ll a12, a13, a23, x12, x13, x23;

ll bit(ll s, ll k)
{
    return ((s & (1 << k)) == (1 << k));
}

void Solve()
{
    cin >> n;
    cout << "AND 1 2" << endl; cin >> a12;
        if (x == -1) return;
    cout << "AND 1 3" << endl; cin >> a13;
        if (x == -1) return;
    cout << "AND 2 3" << endl; cin >> a23;
        if (x == -1) return;
    cout << "XOR 1 3" << endl; cin >> x13;
        if (x == -1) return;
    cout << "XOR 2 3" << endl; cin >> x23;
        if (x == -1) return;
    x12 = x13 ^ x23;
    ll s12 = x12 + 2 * a12, s13 = x13 + 2 *a13, s23 = x23 + 2 * a23;
    ll s = (s12 + s23 + s13) / 2;
    res[0] = s - s23;
    res[1] = s - s13;
    res[2] = s - s12;
    forn(i, 3, n)
    {
        cout << "XOR " << 1 << ' ' << i + 1 << endl;
        ll x; cin >> x;
        if (x == -1) return;
        for (ll j = 1, a = 0; j < n; j *= 2, ++a)
        {
            ll bx = bit(x, a);
            if (!bx) res[i] += (bit(res[0], a) << a);
            else res[i] += ((1 - bit(res[0], a)) << a);
        }
    }
    cout << "!"; forn(i, 0, n) cout << ' ' << res[i];
    cout << flush;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    if (MQ == true)
    {
        cin >> REPIT;
    }
    while (REPIT--) Solve();
    cout.flush();
    #ifdef OFFLINE
    fclose(stdin);
    #endif
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define _itr ::iterator
#define forn(i, x, y) for (ll i = x; i < y; ++i)
#define ford(i, x, y) for (ll i = x; i > y; --i)
#define forne(i, x, y) for (ll i = x; i <= y; ++i)
#define forde(i, x, y) for (ll i = x; i >= y; --i)
#define rd(x) cin >> x; cin.ignore();
#define rdstr(x) getline(cin, x);
#define rdarr(x, y) for (ll i = 0; i < y; ++i) cin >> x[i];
#define rdmtr(x, y, z) for (ll i = 0; i < y; ++i) for (ll j = 0; j < z; ++j) cin >> x[i][j];
#define pb push_back

#define X first
#define Y second

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const ll MaxN = 1e6 + 7;
const ll MaxM = 5e3 + 7;
const ll MDL = 1e9 + 7;
const ll INF = 1e15 + 7;

typedef pair<ll, ll> pi;
typedef pair<pi, ll> pii;
typedef vector<ll> vi;
typedef ll arr[MaxN];

ll REPIT = 1;

const bool MQ = false;

ll n, m;
ll res[MaxN];
ll a12, a13, a23, x12, x13, x23;

ll bit(ll s, ll k)
{
    return ((s & (1 << k)) == (1 << k));
}

void Solve()
{
    cin >> n;
    cout << "AND 1 2" << endl; cin >> a12;
    cout << "AND 1 3" << endl; cin >> a13;
    cout << "AND 2 3" << endl; cin >> a23;
    cout << "XOR 1 3" << endl; cin >> x13;
    cout << "XOR 2 3" << endl; cin >> x23;
    x12 = x13 ^ x23;
    ll s12 = x12 + 2 * a12, s13 = x13 + 2 * a13, s23 = x23 + 2 * a23;
    ll s = (s12 + s23 + s13) / 2;
    res[0] = s - s23;
    res[1] = s - s13;
    res[2] = s - s12;
    forn(i, 3, n)
    {
        cout << "XOR " << 1 << ' ' << i + 1 << endl;
        ll x; cin >> x;
        if (x == -1) return;
        for (ll j = 1, a = 0; j < n; j *= 2, ++a)
        {
            ll bx = bit(x, a);
            if (!bx) res[i] += (bit(res[0], a) << a);
            else res[i] += ((1 - bit(res[0], a)) << a);
        }
    }
    cout << "!"; forn(i, 0, n) cout << ' ' << res[i];
    cout << flush;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    while (REPIT--) Solve();
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define _itr ::iterator
#define forn(i, x, y) for (ll i = x; i < y; ++i)
#define ford(i, x, y) for (ll i = x; i > y; --i)
#define forne(i, x, y) for (ll i = x; i <= y; ++i)
#define forde(i, x, y) for (ll i = x; i >= y; --i)
#define rd(x) cin >> x; cin.ignore();
#define rdstr(x) getline(cin, x);
#define rdarr(x, y) for (ll i = 0; i < y; ++i) cin >> x[i];
#define rdmtr(x, y, z) for (ll i = 0; i < y; ++i) for (ll j = 0; j < z; ++j) cin >> x[i][j];
#define pb push_back

#define X first
#define Y second

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const ll MaxN = 1e6 + 7;
const ll MaxM = 5e3 + 7;
const ll MDL = 1e9 + 7;
const ll INF = 1e15 + 7;

typedef pair<ll, ll> pi;
typedef pair<pi, ll> pii;
typedef vector<ll> vi;
typedef ll arr[MaxN];

ll REPIT = 1;

const bool MQ = false;

ll n, m;
ll res[MaxN];
ll a12, a13, a23, x12, x13, x23;

ll bit(ll s, ll k)
{
    return ((s & (1 << k)) == (1 << k));
}

void Solve()
{
    cin >> n;
    cout << "AND 1 2" << endl; cin >> a12;
    cout << "AND 1 3" << endl; cin >> a13;
    cout << "AND 2 3" << endl; cin >> a23;
    cout << "XOR 1 2" << endl; cin >> x12;
    cout << "XOR 1 3" << endl; cin >> x13;
    cout << "XOR 2 3" << endl; cin >> x23;
    ll s12 = x12 + 2 * a12, s13 = x13 + 2 *a13, s23 = x23 + 2 * a23;
    ll s = (s12 + s23 + s13) / 2;
    res[0] = s - s23;
    res[1] = s - s13;
    res[2] = s - s12;
    forn(i, 3, n)
    {
        cout << "XOR " << 1 << ' ' << i + 1 << endl;
        ll x; cin >> x;
        for (ll j = 1, a = 0; j < n; j *= 2, ++a)
        {
            ll bx = bit(x, a);
            if (!bx) res[i] += (bit(res[0], a) << a);
            else res[i] += ((1 - bit(res[0], a)) << a);
        }
    }
    cout << "!"; forn(i, 0, n) cout << ' ' << res[i];
    cout << flush;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    if (MQ == true)
    {
        cin >> REPIT;
    }
    while (REPIT--) Solve();
    cout.flush();
    #ifdef OFFLINE
    fclose(stdin);
    #endif
}


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

vector <pii> v;
void rec(int i, int num1, int num2, const int curr_or, const int sum, int carry) {
	if(i == 16) {
		v.pb({num1, num2});
		return;
	}

	if(curr_or >> i & 1) {
		if(sum >> i & 1) {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 0);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 0);
			}
		}
		else {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 1);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
		}
	}
	else {
		rec(i + 1, num1, num2, curr_or, sum, 0);
	}
}

int main()
{
	int n, i;
	cin >> n;

	int xo[n];
	fo(i, 1, n) {
		cout << "XOR " << 1 << ' ' << i + 1 << endl;
		int x;
		cin >> x;
		xo[i] = x;
	}

	cout << "AND " << 1 << ' ' << 2 << endl;
	int curr_and;
	cin >> curr_and;

	cout << "OR " << 1 << ' ' << 2 << endl;
	int curr_or;
	cin >> curr_or;

	int sum = xo[1] + 2 * curr_and;
	rec(0, 0, 0, curr_or, sum, 0);

	cout << "AND " << 1 << ' ' << n << endl;
	int last_and;
	cin >> last_and;

	int ans1 = -1;
	for(pii p : v) {
		int num = p.f;
		int last_num = num ^ xo[n - 1];

		bool ok = 1;
		if((num & last_num) != last_and) ok = 0;

		if(ok) {
			ans1 = num;
			break;
		}
	}

	cout << "! " << ans1 << ' ';
	fo(i, 1, n)
	cout << (ans1 ^ xo[i]) << ' ';
	cout << endl;
}


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

vector <pii> v;
void rec(int i, int num1, int num2, const int curr_or, const int sum, int carry) {
	if(i == 16) {
		v.pb({num1, num2});
		return;
	}

	if(curr_or >> i & 1) {
		if(sum >> i & 1) {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 0);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 0);
			}
		}
		else {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 1);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
		}
	}
	else {
		rec(i + 1, num1, num2, curr_or, sum, 0);
	}
}

int main()
{
	boost;
	int n, i;
	cin >> n;

	int xo[n];
	fo(i, 1, n) {
		cout << "XOR " << 1 << ' ' << i + 1 << endl;
		int x;
		cin >> x;
		xo[i] = x;
	}

	cout << "AND " << 1 << ' ' << 2 << endl;
	int curr_and;
	cin >> curr_and;

	cout << "OR " << 1 << ' ' << 2 << endl;
	int curr_or;
	cin >> curr_or;

	int sum = xo[1] + 2 * curr_and;
	rec(0, 0, 0, curr_or, sum, 0);

	cout << "AND " << 1 << ' ' << n << endl;
	int last_and;
	cin >> last_and;

	int ans1 = -1;
	for(pii p : v) {
		int num = p.f;
		int last_num = num ^ xo[n - 1];

		bool ok = 1;
		if((num & last_num) != last_and) ok = 0;

		if(ok) {
			ans1 = num;
			break;
		}
	}

	cout << "! " << ans1 << ' ';
	fo(i, 1, n)
	cout << (ans1 ^ xo[i]) << ' ';
	cout << endl;
}


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

vector <pii> v;
void rec(int i, int num1, int num2, const int curr_or, const int sum, int carry) {
	if(i == 16) {
		v.pb({num1, num2});
		return;
	}

	if(curr_or >> i & 1) {
		if(sum >> i & 1) {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 0);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 0);
			}
		}
		else {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 1);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
		}
	}
	else {
		rec(i + 1, num1, num2, curr_or, sum, 0);
	}
}

int main()
{
	boost;
	int n, i;
	cin >> n;

	int xo[n];
	fo(i, 1, n) {
		cout << "XOR " << 1 << ' ' << i + 1 << endl;
		int x;
		cin >> x;
		xo[i] = x;
	}

	cout << "AND " << 1 << ' ' << 2 << endl;
	int curr_and;
	cin >> curr_and;

	cout << "OR " << 1 << ' ' << 2 << endl;
	int curr_or;
	cin >> curr_or;

	int sum = xo[1] + 2 * curr_and;
	rec(0, 0, 0, curr_or, sum, 0);

	cout << "AND " << n - 1 << ' ' << n << endl;
	int last_and;
	cin >> last_and;

	int ans1 = -1;
	for(pii p : v) {
		int num1 = p.f;
		int last_num1 = num1 ^ xo[n - 1];
		int last_num2 = num1 ^ xo[n - 2];

		/*int num2 = p.s;
		int last_num2 = num2 ^ xo[1] ^ xo[n - 1];

		if(last_num != last_num2) continue;
		if((num1 & num2) != curr_and) continue;
		if((num1 | (num2)) != curr_or) continue;*/

		bool ok = 1;
		if((last_num1 & last_num2) != last_and) ok = 0;
		if((p.f & p.s) != curr_and) ok = 0;
		if((p.f | p.s != curr_or)) ok = 0;
		if((p.f ^ p.s != xo[1])) ok = 0;

		if(ok) {
			ans1 = num1;
			break;
		}
	}

	cout << "! " << ans1 << ' ';
	fo(i, 1, n)
	cout << (ans1 ^ xo[i]) << ' ';
	cout << endl;
}


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

vector <pii> v;
void rec(int i, int num1, int num2, const int curr_or, const int sum, int carry) {
	if(i == 16) {
		v.pb({num1, num2});
		return;
	}

	if(curr_or >> i & 1) {
		if(sum >> i & 1) {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 0);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 0);
			}
		}
		else {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 1);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
		}
	}
	else {
		rec(i + 1, num1, num2, curr_or, sum, 0);
	}
}

int main()
{
	boost;
	int n, i;
	cin >> n;

	int xo[n];
	fo(i, 1, n) {
		cout << "XOR " << 1 << ' ' << i + 1 << endl;
		int x;
		cin >> x;
		xo[i] = x;
	}

	cout << "AND " << 1 << ' ' << 2 << endl;
	int curr_and;
	cin >> curr_and;

	cout << "OR " << 1 << ' ' << 2 << endl;
	int curr_or;
	cin >> curr_or;

	int sum = xo[1] + 2 * curr_and;
	rec(0, 0, 0, curr_or, sum, 0);

	cout << "AND " << n - 1 << ' ' << n << endl;
	int last_and;
	cin >> last_and;

	int ans1 = -1;
	for(pii p : v) {
		int num1 = p.f;
		int last_num1 = num1 ^ xo[n - 1];
		int last_num2 = num1 ^ xo[n - 2];

		/*int num2 = p.s;
		int last_num2 = num2 ^ xo[1] ^ xo[n - 1];

		if(last_num != last_num2) continue;
		if((num1 & num2) != curr_and) continue;
		if((num1 | (num2)) != curr_or) continue;*/

		bool ok = 1;
		if((last_num1 & last_num2) != last_and) ok = 0;
		if((p.f & p.s) != curr_and) ok = 0;
		if((p.f | p.s != curr_or)) ok = 0;
		//if((p.f ^ p.s != xo[1])) ok = 0;

		if(ok) {
			ans1 = num1;
			break;
		}
	}

	cout << "! " << ans1 << ' ';
	fo(i, 1, n)
	cout << (ans1 ^ xo[i]) << ' ';
	cout << endl;
}


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

vector <pii> v;
void rec(int i, int num1, int num2, const int curr_or, const int sum, int carry) {
	if(i == 16) {
		v.pb({num1, num2});
		return;
	}

	if(curr_or >> i & 1) {
		if(sum >> i & 1) {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 0);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 0);
			}
		}
		else {
			if(carry) {
				rec(i + 1, num1 + (1 << i), num2, curr_or, sum, 1);
				rec(i + 1, num1, num2 + (1 << i), curr_or, sum, 1);
			}
			else {
				rec(i + 1, num1 + (1 << i), num2 + (1 << i), curr_or, sum, 1);
			}
		}
	}
	else {
		rec(i + 1, num1, num2, curr_or, sum, 0);
	}
}

int main()
{
	boost;
	int n, i;
	cin >> n;

	int xo[n];
	fo(i, 1, n) {
		cout << "XOR " << 1 << ' ' << i + 1 << endl;
		int x;
		cin >> x;
		xo[i] = x;
	}

	cout << "AND " << 1 << ' ' << 2 << endl;
	int curr_and;
	cin >> curr_and;

	cout << "OR " << 1 << ' ' << 2 << endl;
	int curr_or;
	cin >> curr_or;

	int sum = xo[1] + 2 * curr_and;
	rec(0, 0, 0, curr_or, sum, 0);

	cout << "OR " << n - 1 << ' ' << n << endl;
	int last_and;
	cin >> last_and;

	int ans1 = -1;
	for(pii p : v) {
		int num1 = p.f;
		int last_num1 = num1 ^ xo[n - 1];
		int last_num2 = num1 ^ xo[n - 2];

		/*int num2 = p.s;
		int last_num2 = num2 ^ xo[1] ^ xo[n - 1];

		if(last_num != last_num2) continue;
		if((num1 & num2) != curr_and) continue;
		if((num1 | (num2)) != curr_or) continue;*/

		bool ok = 1;
		if((last_num1 | last_num2) != last_and) ok = 0;
		if((p.f & p.s) != curr_and) ok = 0;

		if(ok) {
			ans1 = num1;
			break;
		}
	}

	cout << "! " << ans1 << ' ';
	fo(i, 1, n)
	cout << (ans1 ^ xo[i]) << ' ';
	cout << endl;
}