def II() -> int : return int(input()) n = II() now = [1] for i in range(2,n+1): print("?",now[-1],i) f = II() assert f != -1 if f: now = now + [i] continue print("?",i,now[0]) f = II() assert f != -1 if f: now = [i] + now continue #二分探索しましょう l = 0 r = len(now)-1 while r-l > 1: mid = (l+r)//2 print("?",now[mid],i) f = II() assert f != -1 if f: l = mid else: r = mid now = now[:r] + [i] + now[r:] print("!") print(n-1) print(*now)