#include <bits/stdc++.h>
using namespace std;
int v[1000005];
int main() {
  int n, x, cnt = 0;
  ;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    v[x] = 1;
  }
  vector<int> a, b;
  for (int i = 1; i + i <= 1000000; i++) {
    int j = 1000000 - i + 1;
    if (v[i] && !v[j]) {
      a.push_back(j);
    } else if (!v[i] && v[j]) {
      a.push_back(i);
    } else if (!v[i] && !v[j]) {
      b.push_back(i);
    } else {
      cnt++;
    }
  }
  for (int t = 0; t < cnt; t++) {
    int i = b[t], j = 1000000 - i + 1;
    a.push_back(i);
    a.push_back(j);
  }
  printf("%d\n", a.size());
  for (size_t i = 0; i < a.size(); i++)
    printf("%d%c", a[i], i + 1 < a.size() ? ' ' : '\n');
}
