#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int n, x;
bool already[1000001] = {0};
int main() {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (n); (i)++) {
    scanf("%d", &x);
    already[x] = 1;
  }
  vector<pair<int, int> > reserve;
  for (int(i) = (1); (i) <= (1000000); (i)++) {
    if (!already[i] && !already[1000001 - i]) {
      reserve.push_back(make_pair(i, 1000001 - i));
    }
  }
  vector<int> an;
  for (int(i) = (1); (i) <= (1000000); (i)++) {
    if (!already[i] && !already[1000001 - i]) continue;
    if (already[i] && !already[1000001 - i]) {
      an.push_back(1000001 - i);
    }
    if (already[i] && already[1000001 - i]) {
      already[i] = 0;
      already[1000001 - i] = 0;
      an.push_back(reserve[((int)(reserve).size()) - 1].first);
      an.push_back(reserve[((int)(reserve).size()) - 1].second);
      reserve.pop_back();
    }
  }
  printf("%d\n", ((int)(an).size()));
  for (int(i) = 0; (i) < (((int)(an).size())); (i)++) printf("%d ", an[i]);
  puts("");
  return 0;
}
