#include <bits/stdc++.h>
using namespace std;
int ok[1000005], a[1000005], vis[1000005];
vector<int> ans;
vector<pair<int, int> > nm;
int main() {
  int n, i, j, x;
  while (scanf("%d", &n) != EOF) {
    memset(ok, 0, sizeof(ok));
    memset(vis, 0, sizeof(vis));
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      ok[a[i]] = 1;
    }
    ans.clear();
    nm.clear();
    for (i = 1; i <= n; i++) {
      if (!ok[i] && !ok[1000000 - i + 1])
        nm.push_back(make_pair(i, 1000000 - i + 1));
    }
    int id = 0;
    for (i = 1; i <= n; i++) {
      if (vis[a[i]]) continue;
      int tmp = 1000000 - a[i] + 1;
      if (!ok[tmp])
        ans.push_back(tmp);
      else {
        ans.push_back(nm[id].first);
        ans.push_back(nm[id++].second);
        vis[tmp] = 1;
      }
    }
    printf("%d\n", ans.size());
    for (i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
