def Bisect_Int(ok,ng,is_ok): while abs(ok-ng)>1: mid=(ok+ng)//2 if is_ok(mid): ok=mid else: ng=mid return ok N=int(input()) fact=[1] for i in range(1,N+1): fact.append(fact[-1]*i) ok=0 ng=fact[N] def is_ok(mid): lst=[i for i in range(N)] Q=[] for i in range(N): j=mid//fact[N-1-i] mid%=fact[N-1-i] Q.append(lst[j]) lst=lst[:j]+lst[j+1:] print("?",*[q+1 for q in Q]) return int(input()) ok=Bisect_Int(ok,ng,is_ok) lst=[i for i in range(N)] Q=[] for i in range(N): j=ok//fact[N-1-i] ok%=fact[N-1-i] Q.append(lst[j]) lst=lst[:j]+lst[j+1:] print("!",*[q+1 for q in Q])