#include <bits/stdc++.h>
using namespace std;
int a[500010];
int Hash[1000100];
vector<int> v;
int main() {
  int n;
  int s = 1000001;
  while (~scanf("%d", &n)) {
    v.clear();
    memset(Hash, 0, sizeof(Hash));
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
      Hash[a[i]] = 1;
    }
    int num = 0;
    for (int i = 0; i < n; ++i) {
      if (Hash[a[i]] == 1 && Hash[s - a[i]] == 1 && a[i] * 2 < s) {
        num++;
      }
    }
    for (int i = 0; i < n; ++i) {
      if (Hash[a[i]] == 1 && Hash[s - a[i]] == 0) {
        v.push_back(s - a[i]);
        Hash[a[i]] = Hash[s - a[i]] = 1;
      }
    }
    int cas = 0;
    for (int i = 1; i < s && num > 0; ++i) {
      if (!Hash[i]) {
        v.push_back(i);
        v.push_back(s - i);
        Hash[i] = 1;
        Hash[s - i] = 1;
        num -= 1;
      }
    }
    printf("%d\n", v.size());
    for (int i = 0; i < v.size() - 1; ++i) {
      cout << v[i] << " ";
    }
    cout << v[v.size() - 1] << endl;
  }
  return 0;
}
