#include <bits/stdc++.h>
using namespace std;
int mark[1000005];
int main() {
  int s = 1e6;
  int n;
  scanf("%d", &n);
  vector<int> v;
  set<int> S, X;
  for (int i = 1; i <= 500000; i++) S.insert(i);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    mark[x] = 1;
    if (S.find(x) != S.end()) S.erase(x);
    if (S.find(s - x + 1) != S.end()) S.erase(s - x + 1);
    X.insert(x);
  }
  vector<int> res;
  for (auto it = X.begin(); it != X.end(); it++) {
    int val = *it;
    if (X.find(s - val + 1) != X.end()) {
      int aux = *(S.begin());
      res.push_back(aux);
      res.push_back(s - aux + 1);
      S.erase(S.begin());
      X.erase(s - val + 1);
    } else {
      res.push_back(s - val + 1);
      if (S.find(s - val + 1) != S.end()) S.erase(s - val + 1);
    }
  }
  cout << res.size() << endl;
  for (int val : res) cout << val << " ";
  cout << endl;
  return 0;
}
