#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long int min(long long int a, long long int b) {
  if (a < b) {
    return a;
  }
  return b;
}
long long int power(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      res = (res * x) % 998244353;
    }
    x = (x * x) % 998244353;
    n = n / 2;
  }
  return res % 998244353;
}
long long int factorialNumInverse[1000001];
long long int naturalNumInverse[1000001];
long long int fact[1000001];
void InverseofNumber(long long int n, long long int p) {
  naturalNumInverse[0] = naturalNumInverse[1] = 1;
  for (long long int i = 2; i <= n; i++)
    naturalNumInverse[i] = naturalNumInverse[p % i] * (p - p / i) % p;
}
void InverseofFactorial(long long int n, long long int p) {
  factorialNumInverse[0] = factorialNumInverse[1] = 1;
  for (long long int i = 2; i <= n; i++)
    factorialNumInverse[i] =
        (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
}
void factorial(long long int n, long long int p) {
  fact[0] = 1;
  for (long long int i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % p;
  }
}
long long int nCrModp(long long int n, long long int r, long long int p) {
  long long int ans =
      ((fact[n] * factorialNumInverse[r]) % p * factorialNumInverse[n - r]) % p;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int arr[n];
  long long int sum = 0;
  vector<long long int> y;
  vector<long long int> b;
  map<long long int, long long int> m;
  for (int i = 1; i <= 1000000; i++) {
    m[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]] = 1;
  }
  int cnt = 0;
  for (int i = 1; i <= 500000; i++) {
    if (m[i] && m[1000000 + 1 - i]) {
      cnt++;
      continue;
    }
    if (m[i] && !m[1000000 + 1 - i]) {
      y.push_back(1000000 + 1 - i);
      continue;
    }
    if (!m[i] && m[1000000 - i + 1]) {
      y.push_back(i);
      continue;
    }
    if (!m[i] && !m[1000000 - i + 1]) {
      b.push_back(i);
    }
  }
  for (int i = 0; i < cnt; i++) {
    y.push_back(b[i]);
    y.push_back(1000000 - b[i] + 1);
  }
  cout << y.size() << "\n";
  for (int i = 0; i < n; i++) {
    cout << y[i] << " ";
  }
  cout << "\n";
  return 0;
}
