#include <bits/stdc++.h>
using namespace std;
int vis[1000005];
int a[1000005];
vector<int> ans;
int main() {
  int n, x, i, j;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    vis[a[i]] = 1;
  }
  int cnt = 0;
  int s = 1000001;
  for (i = 0; i < n; i++) {
    x = a[i];
    if (!vis[s - x]) {
      ans.push_back(s - x);
      vis[s - x] = 1;
    } else
      cnt++;
  }
  for (i = 1; i <= 1000000 && cnt; i++) {
    if (!vis[i] && !vis[s - i]) {
      cnt -= 2;
      ans.push_back(i);
      ans.push_back(s - i);
    }
  }
  int m = ans.size();
  printf("%d\n", ans.size());
  for (i = 0; i < m; i++) printf("%d ", ans[i]);
}
