#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
const int s = 1000000;
int n;
int b[maxn];
int p[maxn];
int c[maxn];
vector<int> ans;
int main() {
  scanf("%d", &n);
  int t;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &t);
    b[t] = 1;
    p[i] = t;
  }
  int l = 1;
  for (int i = 0; i < n; ++i) {
    if (c[p[i]] == 0) {
      if (b[s - p[i] + 1] == 0) {
        ans.push_back(s - p[i] + 1);
        b[s - p[i] + 1] = 1;
      } else {
        while (b[l] || b[s - l + 1]) {
          l++;
        }
        ans.push_back(l);
        b[l] = 1;
        ans.push_back(s - l + 1);
        b[s - l + 1] = 1;
        c[s - p[i] + 1] = 1;
      }
    }
  }
  printf("%ld\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
