#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
template <typename T, typename S>
vector<T>& operator<<(vector<T>& a, S b) {
  a.push_back(b);
  return a;
}
template <typename T>
void operator>>(vector<T>& a, int b) {
  while (b--)
    if (!a.empty()) a.pop_back();
}
bool isprime(int n) {
  if (n < 2) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long b_pow(long long x, long long n) {
  return n ? b_pow(x * x, n / 2) * (n % 2 ? x : 1) : 1ll;
}
string itos(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
int n;
int a[1000100];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  int s = 1000000;
  vector<int> v;
  vector<int> y;
  for (int i = 1; i <= s; i++) {
    if (a[i] == 1 && a[s - i + 1] == 0) {
      y.push_back(s - i + 1);
    }
  }
  int cnt = 0;
  for (int i = 1; i <= s / 2; i++) {
    if (a[i] == 1 && a[s - i + 1] == 1) {
      cnt++;
    }
  }
  for (int i = 1; i <= s / 2; i++) {
    if (cnt && a[i] == 0 && a[s - i + 1] == 0) {
      y.push_back(i);
      y.push_back(s - i + 1);
      a[i] = 1;
      cnt--;
    }
  }
  if (cnt)
    while (1) {
    }
  cout << y.size() << endl;
  for (int i = 0; i < y.size(); i++) cout << y[i] << " ";
  cout << endl;
}
