#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 1;
int mark[M], ans[M], n, m, x, p;
int32_t main() {
  cin >> n;
  while (n--) scanf("%d", &x), mark[x] = 1;
  for (int i = 1; i <= M / 2; i++)
    if (mark[i] && mark[M - i])
      p++;
    else if (mark[i])
      ans[m++] = M - i;
    else if (mark[M - i])
      ans[m++] = i;
  for (int i = 1; p && i <= M / 2; i++)
    if (!mark[i] && !mark[M - i]) ans[m++] = i, ans[m++] = M - i, p--;
  cout << m << endl;
  while (m) printf("%d ", ans[--m]);
  return 0;
}
