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];
        for (int i = 1; i <= n; i++)
        {
            num++;
            int l = i, r = n + 1;
            while (r - l > 1)
            {
                int m = (l + r) / 2;
                Console.WriteLine("? " + l + " " + m);
                int k = int.Parse(Console.ReadLine());
                if (k == 1)
                    l = m;
                else
                    r = m;
            }
            for (; i <= l; i++)
                a[i] = num;
            i--;
        }
        Console.WriteLine("Ready!");
        Console.WriteLine(num);
        for (int i = 1; i <= n; i++)
            Console.Write(a[i] + " ");
//        Console.ReadLine();
    }
}