#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long m;
  cin >> m;
  unordered_set<long long> taken, bundle;
  vector<long long> ans;
  long long complements = 0;
  for (long long i = 1; i <= N; ++i) bundle.insert(i);
  for (long long i = 0; i < m; ++i) {
    long long buf;
    cin >> buf;
    taken.insert(buf);
    bundle.erase(bundle.find(buf));
  }
  while (taken.size()) {
    long long take = *taken.begin();
    taken.erase(taken.begin());
    if (bundle.find(N - take + 1) == bundle.end())
      ++complements;
    else {
      bundle.erase(bundle.find(N - take + 1));
      ans.push_back(N - take + 1);
    }
  }
  complements /= 2;
  while (complements) {
    long long take = *bundle.begin();
    bundle.erase(bundle.begin());
    if (bundle.find(N - take + 1) != bundle.end()) {
      ans.push_back(N - take + 1);
      ans.push_back(take);
      bundle.erase(N - take + 1);
      --complements;
    }
  }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it << " ";
  cout << "\n";
}
