program q;
var a,b:array[0..3000]of longint;
i,j,k,n,m,l:longint;
procedure sort(first,last:longint);
var count,mid,f,l:longint;
begin
   f:=first;
   l:=last;
   mid:=b[(f+l) div 2];
   repeat
      while b[f]>mid do inc(f);
      while b[l]<mid do dec(l);
      if f<=l
      then begin
              count:=b[l];
              b[l]:=b[f];
              b[f]:=count;
              inc(f);
              dec(l)
           end;
   until f>l;
   if first<l
   then sort(first,l);
   if f<last
   then sort(f,last);
end;
begin
  { assign(input,'video.in'); reset(input);
   assign(output,'video.out'); rewrite(output);
   }readln(n);
   a[1]:=1;
   b[1]:=1;
   i:=2;
   m:=1;
   while i<=n do
   begin
      j:=m;
      k:=0;
      while (j>0)and ((k=m-j) or (k=0)) do
      begin
          writeln('? ',b[j],' ',i);
          flush(output);
          readln(k);
          dec(j);
      end;
      if k=m-j
      then begin a[i]:=a[b[j+1]]; b[j+1]:=i end
      else begin inc(m); b[m]:=i; a[i]:=m end;
      sort(1,m);
      inc(i)
   end;
   writeln('Ready!');
   writeln(m);
   for i:=1 to n do
   write(a[i],' ');
end.
