#!/usr/bin/python3

import sys

n = int(input())
k = n//2;
pairs = []
ans = [-1]*(n+1)
for i in range(k):
    print('?', 2*i+1, 2*i+2, flush=True)
    x, y = [int(i) for i in input().split()]
    pairs.append((x, y, 2*i+1, 2*i+2))

pos = [-1]*(k+1)
while len(pairs)>0:
    a, b, p1, p2 = pairs.pop()
    if a==b:
        ans[p1] = a
        ans[p2] = b
    elif pos[a] != -1:
        c, q1, q2 = pos[a]
        print('?', p1, q1, flush=True)
        x, y = [int(i) for i in input().split()]
        pos[a] = -1
        pos[c] = -1
        if x == a == y:
            ans[p1] = a
            ans[p2] = b
            ans[q1] = a
            ans[q2] = c
        elif x != a != y:
            ans[p2] = a
            ans[q2] = a
            pairs.append((b, c, p1, q1)) 
        elif b == c:
            pos[a] = (c, p1, q1)
            pos[c] = (a, p1, q1)
            pairs.append((a, b, p2, q2))
        elif x == b or y == b:
            ans[p2] = a
            ans[q2] = c
            pairs.append((a, b, p1, q1))
        else:
            pos[a] = (c, p1, q1)
            pos[c] = (a, p1, q1)
            ans[p2] = b
            ans[q2] = a
    elif pos[b] != -1:
        c, q1, q2 = pos[b]
        print('?', p1, q1, flush=True)
        x, y = [int(i) for i in input().split()]
        pos[b] = -1
        pos[c] = -1
        if x == b == y:
            ans[p1] = b
            ans[p2] = a
            ans[q1] = b
            ans[q2] = c
        elif x != b != y:
            ans[p2] = b
            ans[q2] = b
            pairs.append((a, c, p1, q1)) 
        elif a == c:
            pos[b] = (c, p1, q1)
            pos[c] = (b, p1, q1)
            pairs.append((a, b, p2, q2))
        elif x == a or y == a:
            ans[p2] = b
            ans[q2] = c
            pairs.append((a, b, p1, q1))
        else:
            pos[b] = (c, p1, q1)
            pos[c] = (b, p1, q1)
            ans[p2] = a
            ans[q2] = b
    else:
        pos[a] = (b, p1, p2)
        pos[b] = (a, p1, p2)

for a in range(k+1):
    if pos[a] != -1:
        b, p1, p2 = pos[a]
        pos[a] = -1
        pos[b] = -1
        pairs.append((a,b,p1,p2))

while len(pairs)>1:
    a1, a2, p1, p2 = pairs.pop()
    b1, b2, q1, q2 = pairs.pop()
    print('?', p1, q1, flush=True)
    x, y = [int(i) for i in input().split()]
    ans[p2] = a1 if a2 in [x,y] else a2
    ans[q2] = b1 if b2 in [x,y] else b2
    pairs.append((x,y,p1,q1))

if len(pairs) == 1:
    a, b, p1, p2 = pairs[0]
    p3 = ans.index(a)
    x, y = a, b
    while b in [x,y]:
        p2, p3 = p3, p2
        print('?', p1, p2, flush=True)
        x, y = [int(i) for i in input().split()]
    ans[p1] = a
    ans[p2] = a
    ans[p3] = b
    
print('!',*ans[1:],flush=True)
