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)]
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])
        if len(vars) == 1:
            break
    a[i] = vars.pop()

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