def divide(arr, depth, m):
if len(complements) <= depth:
complements.append(2 ** (depth + 2) + 1)
complement = complements[depth]
for i in range(2):
if complement - arr[i] <= m:
arr[i] = [arr[i], complement - arr[i]]
divide(arr[i], depth + 1, m)
m = int(raw_input())
arr = [1, 2]
complements = []
divide(arr, 0, m)
print arr
ZGVmIGRpdmlkZShhcnIsIGRlcHRoLCBtKToKICAgIGlmIGxlbihjb21wbGVtZW50cykgPD0gZGVwdGg6CiAgICAgICAgY29tcGxlbWVudHMuYXBwZW5kKDIgKiogKGRlcHRoICsgMikgKyAxKQogICAgY29tcGxlbWVudCA9IGNvbXBsZW1lbnRzW2RlcHRoXQogICAgZm9yIGkgaW4gcmFuZ2UoMik6CiAgICAgICAgaWYgY29tcGxlbWVudCAtIGFycltpXSA8PSBtOgogICAgICAgICAgICBhcnJbaV0gPSBbYXJyW2ldLCBjb21wbGVtZW50IC0gYXJyW2ldXQogICAgICAgICAgICBkaXZpZGUoYXJyW2ldLCBkZXB0aCArIDEsIG0pCgptID0gaW50KHJhd19pbnB1dCgpKQoKYXJyID0gWzEsIDJdCmNvbXBsZW1lbnRzID0gW10KCmRpdmlkZShhcnIsIDAsIG0pCnByaW50IGFycg==
[[[[1, 16], [8, 9]], [[4, 13], [5, 12]]], [[[2, 15], [7, 10]], [[3, 14], [6, 11]]]]