#include <bits/stdc++.h>
using namespace std;
int vis[1000006];
int X[500005];
vector<int> v;
int main() {
  int n, x, s = 1000000;
  scanf("%d", &n);
  long long int C = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", X + i);
    vis[X[i]] = true;
  }
  int ptr = 1;
  for (int i = 1; i <= n; i++) {
    long long int sym = s - X[i] + 1;
    if (!vis[sym])
      v.push_back(sym);
    else if (vis[sym] != 2) {
      while (vis[ptr] or vis[s - ptr + 1]) ptr++;
      v.push_back(ptr);
      v.push_back(s - ptr + 1);
      vis[ptr] = 2;
      vis[X[i]] = 2;
    }
  }
  printf("%d\n", int(v.size()));
  for (auto z : v) printf("%d ", z);
}
