#include <bits/stdc++.h>
using namespace std;
const int s = 1000000;
int x[501000];
bool flag[501000 << 1];
int n;
int ans[501000];
vector<int> tmp;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
    flag[x[i]] = 1;
  }
  int cnt = 0;
  int k = 0;
  for (int i = 1; i <= 500000; i++) {
    if (flag[i]) {
      if (!flag[s + 1 - i]) {
        ans[cnt++] = s + 1 - i;
      } else
        k++;
    } else {
      if (flag[s + 1 - i]) {
        ans[cnt++] = i;
      } else {
        tmp.push_back(i);
      }
    }
  }
  for (int i = 0; i < k; i++) {
    ans[cnt++] = tmp[i];
    ans[cnt++] = s + 1 - tmp[i];
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) printf("%d ", ans[i]);
  return 0;
}
