#include <bits/stdc++.h>
using namespace std;
int u[1000007];
int a[1000007 / 2], s = 1000000;
vector<int> ans;
int main() {
  int n, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    u[a[i]] = 1;
  }
  int j = 1, z;
  for (i = 1; i <= n; i++) {
    z = s - a[i] + 1;
    if (u[a[i]] == 2) continue;
    if (u[z] == 0) {
      ans.push_back(z);
      u[z] = 1;
    } else {
      while (u[j] > 0 || u[s - j + 1] > 0) j++;
      ans.push_back(j);
      ans.push_back(s - j + 1);
      u[j] = 1;
      u[s - j + 1] = 1;
      u[z] = 2;
    }
  }
  printf("%d\n", ans.size());
  for (i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
