n = int(input())

a = [1] * (n + 1)
cur = 1
cnt = 0
q = 72000
k = n
res = [[1] * (n + 1) for i in range(n + 1)]

if n > 300:
    k = 10
    for i in range(1, n + 1):
        vars = {i for i in range(1, k + 1)}
        for j in range(1, i):
            print('?', j, i)
            res1 = int(input())
            print('?', j, i - 1)
            res2 = int(input())
            if res1 > res2:
                for k1 in range(j, i):
                    vars.discard(a[k1])
            else:
                vars &= set(a[j:i])
            if len(vars) == 1:
                break
        a[i] = min(vars)        
else:
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            print('?', i, j)
            res[i][j] = int(input())
    for i in range(2, n + 1):
        vars = {i for i in range(1, k + 1)}
        for j in range(1, i):
            if res[j][i] > res[j][i - 1]:
                for k1 in range(j, i):
                    vars.discard(a[k1])
            else:
                vars &= set(a[j:i])
            if len(vars) == 1:
                break
        a[i] = min(vars)

k = len(set(a))
print('Ready!')
print(k)
print(*a[1:])