#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long m, k = 1, n, a[2000005], b[2000005] = {0}, dpA[20005] = {0}, res = 0,
             dpB[20005] = {0};
set<long long> st, st1, st2;
string s1 = "";
vector<long long> v, vnode[200005], v1, v2, v3;
vector<pair<long long, long long> > vv;
vector<pair<long long, pair<long long, long long> > > vvv;
priority_queue<long long> pq;
map<long long, long long> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long i = 0, x, y, j = 0, z = 0, q, ans = 0, s = 1000000, nb0 = 0, nb = 0,
            nbmax = 0, nbinf = 0, sm = 0, nb2 = 0, mm = 5e8, idx = 0, ok = 0, l,
            r, negatif = 0, positif = 0, l1, r1;
  set<long long>::iterator it, it1, it2;
  char c;
  cin >> n;
  m = 0;
  for (i = 1; i <= n; i++) cin >> a[i], st.insert(a[i]), sm += (a[i] - 1);
  for (i = 1; i <= (s / 2); i++) {
    x = i;
    long long invx = s - i + 1;
    if (!st.count(invx) && !st.count(i) && invx != i) vv.push_back({i, invx});
  }
  sort(a + 1, a + 1 + n);
  for (i = 1; i <= n; i++) {
    x = a[i];
    long long invx = s - a[i] + 1;
    if (st.count(a[i]) && !st.count(invx))
      st1.insert(invx);
    else if (st.count(a[i])) {
      st.erase(a[i]);
      st.erase(invx);
      long long sz = vv.size();
      sz--;
      if (sz >= 0) {
        st1.insert(vv[sz].first);
        st1.insert(vv[sz].second);
        vv.pop_back();
      }
    }
  }
  cout << st1.size() << endl;
  for (it = st1.begin(); it != st1.end(); it++) cout << (*it) << " ";
}
