{$MAXSTACKSIZE $11110000}
uses Math,SysUtils;
type mass=array[0..3000] of longint;
var ee,a,b,c,i,n,k,z:longint;
    res,m,used:mass;
{procedure rec(l,r,kol:longint;m:mass);
var c,z,md,a1,a2:longint;m1,m2:mass;
Begin
   if kol=1
   then Begin
           for z:=l to r do
              res[z]:=m[1];
           exit;
        end;
   md:=(l+r) div 2;
   writeln('? ',l,' ',md);
   flush(output);
   readln(a1);
   writeln('? ',md+1,' ',r);
   flush(output);
   readln(a2);
   for z:=1 to a1+a2-kol do
      Begin
          m1[z]:=m[z];
          m2[z]:=m[z];
      end;
   for z:=a1+a2-kol+1 to a1 do
       m1[z]:=m[z];
   c:=a1+a2-kol;
   for z:=a1+1 to kol do
      Begin
          inc(c);
          m2[c]:=m[z];
      end;
   rec(l,md,a1,m1);
   rec(md+1,r,a2,m2);
end; }
begin
 //  assign(input,'input.txt');
 //  assign(output,'output.txt');
   readln(n);
   if n=1
   then Begin
           writeln('Ready!');
           writeln(1);
           writeln(1);
           flush(output);
           halt(0);
        end;
   res[1]:=1;
   ee:=0;
   for i:=2 to n do
      Begin
          fillchar(used,sizeof(used),0);
          for z:=i-1 downto 1 do
             if used[res[z]]=0
             then Begin
                     if ee>71000
                     then halt(1);
                     used[res[z]]:=1;
                     writeln('? ',z,' ',i);
                     flush(output);
                     readln(a);
                     writeln('? ',z+1,' ',i);
                     flush(output);
                     readln(b);
                     inc(ee,2);
                     if a=b
                     then Begin
                             res[i]:=res[z];
                             break;
                          end;
                  end;
          if res[i]=0
          then Begin
                  k:=0;
                  for z:=1 to i-1 do
                     k:=max(k,res[z]);
                  res[i]:=k+1;
               end;
      end;
   writeln('Ready!');
   k:=0;
   for i:=1 to n do
      k:=max(k,res[i]);
   writeln(k);
   for i:=1 to n do
      write(res[i],' ');
   writeln;
   flush(output);
end. 
