#include <bits/stdc++.h>
using namespace std;
const int s = 1e6;
int vis[s];
int main() {
  int n, t;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    vis[t] = 1;
  }
  printf("%d\n", n);
  int num = 0;
  for (int i = 0; i < s + 2; i++) {
    if (vis[i] == 1) {
      if (vis[s - i + 1] == 0) {
        printf("%d ", s - i + 1);
        num++;
      }
    }
  }
  for (int i = 1; num < n; i++) {
    if (vis[i] == 0 && vis[s - i + 1] == 0) {
      printf("%d %d ", s - i + 1, i);
      num += 2;
    }
  }
  puts("");
  return 0;
}
