#include <bits/stdc++.h>

using namespace std;

void solve()
{
    int n;
    cin >> n;
    vector<int> ans(n, 1);

    int i = 0;
    int j = 0;
    int k;
    while (++j < n)
    {
        cout << "? " << i+1 << ' ' << j+1 << endl;
        cin >> k;
        if (k == 2)
            ans[j] = (ans[i] == 1 ? 2 : 1),
            i = j;
        else
            ans[j] = ans[i];
    }

    cout << "Ready!" << endl;
    cout << (find(ans.begin(), ans.end(), 2) != ans.end() ? 2 : 1) << endl;
    for (int it : ans)
        cout << it << ' ';
}

int main()
{
    ios_base::sync_with_stdio(false);

    solve();

    return 0;
}
