#include <bits/stdc++.h>
const int inf = 1 << 30;
const long long INF = 1ll << 61;
using namespace std;
const int MOD = 1000000;
int n;
int nnum[500000 + 55];
int vis[1000000 + 55];
int flag[1000000 + 55];
vector<int> G;
void init() {
  memset(flag, 0, sizeof(flag));
  memset(nnum, 0, sizeof(nnum));
  memset(vis, 0, sizeof(vis));
  G.clear();
}
bool input() {
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &nnum[i]);
      vis[nnum[i]]++;
    }
    return false;
  }
  return true;
}
void cal() {
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (vis[nnum[i]] && !vis[MOD - nnum[i] + 1]) {
      flag[MOD - nnum[i] + 1]++;
      cnt++;
    }
  }
  for (int i = 1; i <= MOD && cnt < n; i++) {
    if (!vis[i] && !vis[MOD - i + 1]) {
      flag[i] = 1;
      cnt++;
      flag[MOD - i + 1] = 1;
      cnt++;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= MOD; i++)
    if (flag[i]) printf("%d ", i);
  puts("");
}
void output() {}
int main() {
  while (true) {
    init();
    if (input()) return 0;
    cal();
    output();
  }
  return 0;
}
