Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris.

There are exactly *s* blocks in Chris's set, each block has a unique number from 1 to *s*. Chris's teacher picks a subset of blocks *X* and keeps it to himself. He will give them back only if Chris can pick such a non-empty subset *Y* from the remaining blocks, that the equality holds: 

For example, consider a case where *s* = 8 and Chris's teacher took the blocks with numbers 1, 4 and 5. One way for Chris to choose a set is to pick the blocks with numbers 3 and 6, see figure. Then the required sums would be equal: (1 - 1) + (4 - 1) + (5 - 1) = (8 - 3) + (8 - 6) = 7.

However, now Chris has exactly *s* = 10<sup class="upper-index">6</sup> blocks. Given the set *X* of blocks his teacher chooses, help Chris to find the required set *Y*!
The first line of input contains a single integer *n* (1 ≤ *n* ≤ 5·10<sup class="upper-index">5</sup>), the number of blocks in the set *X*. The next line contains *n* distinct space-separated integers *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup>), the numbers of the blocks in *X*.

Note: since the size of the input and output could be very large, don't use slow output techniques in your language. For example, do not use input and output streams (cin, cout) in C++.
import sys
INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br


"""
Facts and Data representation
Constructive? Top bottom up down
"""
n, = I()
a = I()
M = 10 ** 6 + 1
take = [0] * M
for i in a:
  take[i] = 1

ans = []
ok = []
cnt = 0
for i in range(1, M // 2 + 1):
  if take[i] and take[M - i]:
    cnt += 1
  elif not take[i] and not take[M - i]:
    ok.append((i, M - i))
  elif take[i]:
    ans.append(M - i)
  else:
    ans.append(i)

for i in range(cnt):
  ans.append(ok[i][0])
  ans.append(ok[i][1])

print(len(ans))
print(*ans)