#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 123;
int mark[maxn];
vector<int> Res;
int n, x, maxd = 1000000, t;
int main() {
  cin >> n;
  while (n--) {
    cin >> x;
    mark[x] = 1;
  }
  for (int i = 1; i <= maxd; i++)
    if (mark[i] == 1 && mark[maxd - i + 1] == 0) {
      mark[maxd - i + 1] = 2;
      Res.push_back(maxd - i + 1);
    } else if (mark[i] == 1 && mark[maxd - i + 1] == 1)
      t++, mark[maxd - i + 1] = 2;
  for (int i = 1; i <= maxd; i++)
    if (t > 0 && mark[i] == 0 && mark[maxd - i + 1] == 0) {
      Res.push_back(i);
      Res.push_back(maxd - i + 1);
      t--;
    }
  cout << Res.size() << endl;
  for (__typeof(Res.begin()) i = Res.begin(); i != Res.end(); ++i)
    cout << (*i) << " ";
  return 0;
}
