#include <bits/stdc++.h>
using namespace std;
const long long mod7 = 1000000007;
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int arr[1000001];
int main() {
  int n;
  scanf("%d", &n);
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    arr[x] = 1;
    sum += x - 1;
  }
  int cnt = 0;
  int ans = 0;
  for (int i = 1; i <= 1000000; ++i) {
    if (arr[i] == 1) {
      if (arr[1000001 - i] == 0) {
        arr[1000001 - i] = -1;
        ++ans;
      } else
        ++cnt;
    }
  }
  if (arr[1000000] == 0) {
    arr[1000000] = -1;
    ++ans;
  }
  printf("%d\n", ans + cnt);
  cnt /= 2;
  for (int i = 1; i <= 1000000 && cnt; ++i) {
    if (arr[i] == 0 && arr[1000001 - i] == 0) {
      --cnt;
      arr[i] = arr[1000001 - i] = -1;
    }
  }
  for (int i = 1; i <= 1000000; ++i)
    if (arr[i] == -1) printf("%d ", i);
  return 0;
}
