#include <bits/stdc++.h>
using namespace std;
int const mxn = 1e6 + 10;
int mark[mxn];
int m = 1000000;
int main() {
  int n, q = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mark[a] = 1;
  }
  cout << n << endl;
  for (int i = 1; i <= m; i++) {
    if (mark[i] == 1 and mark[m - i + 1] == 0) {
      cout << m - i + 1 << " ";
      q++;
    }
  }
  int i = 1;
  while (q < n - 1) {
    if (mark[i] == 0 and mark[m - i + 1] == 0) {
      q += 2;
      cout << i << " " << m - i + 1 << " ";
    }
    i++;
  }
}
