def solve(): n=int(input()) fact=[] def go(pos): arr=[] for i in range(1,n+1): arr.append(i) for i in range(n,0,-1): j=0 cur=0 while(1): cur1=cur+fact[i-1] if(cur1>pos): break else: j+=1 cur=cur1 pos-=cur val=arr[j] arr.pop(j) print(val,end=' ') print() def getans(pos): print("!",end=' ') go(pos) exit(0) def check(pos): print("?",end=' ') go(pos) ans=int(input()) return (ans==1) fact.append(1) ls=1 for i in range(1,500): ls*=i fact.append(ls) low=0 up=fact[n] while(up-low>1): mid=(low+up)//2 if(check(mid)): low=mid else: up=mid getans(low) solve()