#include <bits/stdc++.h>
using namespace std;
int n;
int x[500010];
bool vis[1000010];
int m;
int all[1000010];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", x + i);
    vis[x[i]] = 1;
  }
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (!vis[1000000 - x[i] + 1])
      all[m++] = 1000000 - x[i] + 1;
    else
      t++;
  }
  t /= 2;
  for (int i = 1; i <= 1000000 && t > 0; i++) {
    if (!vis[i] && !vis[1000000 - i + 1]) {
      t--;
      all[m++] = i;
      all[m++] = 1000000 - i + 1;
    }
  }
  printf("%d\n", m);
  for (int i = 0; i < m; i++) printf("%d ", all[i]);
  return 0;
}
