#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 333;
const long long linf = 1e18 + 333;
const int M = 1e6;
const int N = 1e6 + 5;
int n;
bool h[N];
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (h[M + 1 - x]) cnt++;
    h[x] = 1;
  }
  printf("%d\n", n);
  for (int i = 1; i <= M; i++)
    if (h[i] and !h[M + 1 - i]) printf("%d ", M + 1 - i);
  for (int i = 1; i <= M and cnt; i++) {
    if (!h[i] and !h[M + 1 - i]) {
      printf("%d %d ", i, M + 1 - i);
      cnt--;
    }
  }
  puts("");
  return 0;
}
