using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine()), num = 0;
        int[] a = new int[n + 1];
        int[,] m = new int[n + 1, n + 1];
        for (int i = 1; i <= n; i++)
            m[i, i] = 1;
        List<int> sw = new List<int>();
        for (int i = 0; i <= n + 2; i++)
            sw.Add(0);
        for (int i = 1; i <= n; i++)
        {
            num++;
            sw[num] = i;
            int l = i, r = n + 1;
            int k = 0;
            if (m[l, n] == 0)
            {
                Console.WriteLine("? " + l + " " + n);
                k = m[l, n] = int.Parse(Console.ReadLine());
            }
            else
                k = m[l, n];
            if (k == 1)
                    l = n;
            while (r - l > 1)
            {
                int c = (l + r) / 2;
                if (m[l, c] == 0)
                {
                    Console.WriteLine("? " + l + " " + c);
                    k = m[l, c] = int.Parse(Console.ReadLine());
                }
                else
                    k = m[l, c];
                if (k == 1)
                    l = c;
                else
                    r = c;
            }
            for (; i <= l; i++)
                a[i] = num;
            i--;
        }
        int j = 3;
        while (true)
        {
            int k = 0;
            j = 3;
            while (sw[j] != 0)
            {
                if (m[sw[1], sw[j]] == 0)
                {
                    Console.WriteLine("? " + sw[1] + " " + sw[j]);
                    k = m[sw[1], sw[j]] = int.Parse(Console.ReadLine());
                }
                else
                    k = m[sw[1], sw[j]];
                if (j > k)
                    break;
                j++;
            }
            if (sw[j] == 0)
                break;
            int pred = k, l = 1;
            do
            {
                pred = k;
                l++;
                if (m[sw[l], sw[j]] == 0)
                {
                    Console.WriteLine("? " + sw[l] + " " + sw[j]);
                    k = m[sw[l], sw[j]] = int.Parse(Console.ReadLine());
                }
                else
                    k = m[sw[l], sw[j]];
            } while (pred != k);
           /* while (pred == k)
            {
                l++;
                pred = k;
                if (m[sw[l], sw[j]] == 0)
                {
                    Console.WriteLine("? " + sw[l] + " " + sw[j]);
                    k = m[sw[l], sw[j]] = int.Parse(Console.ReadLine());
                }
                else
                    k = m[sw[l], sw[j]];
            }*/
            int end = sw[j + 1] == 0 ? n + 1 : sw[j + 1];
            for (int o = sw[j]; o < end; o++)
                a[o] = a[sw[l - 1]];
            sw.RemoveAt(j);
        }
        num = 0;
        for (int i = 1; i <= n; i++)
            num = Math.Max(num, a[i]);
        Console.WriteLine("Ready!");
        Console.WriteLine(num);
        for (int i = 1; i <= n; i++)
            Console.Write(a[i] + " ");
 //       Console.ReadLine();
    }
}