n = int(input())

a = [1] * (n + 1)
cur = 1
cnt = 0
q = 30000
for i in range(2, n + 1):
    print('?', 1, i)
    cnt += 1
    if cnt >= q: print(1 / 0)
    res = int(input())
    if res > cur:
        cur += 1
        a[i] = cur
    else:
        elem = cur
        s = {elem}
        a[i] = elem
        for j in range(i - 1, 0, -1):
            s.add(a[j])
            print('?', j, i)
            cnt += 1
            if cnt >= q: print(1 / 0)
            res = int(input())
            if res == len(s):
                break
            s.discard(a[i])
            a[i] = a[j]
            s.add(a[j])

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