#include <bits/stdc++.h>
using namespace std;
const int s = 1e6, maxn = 5 * (1e5);
int n, a[maxn + 1], k;
bool ex[s + 1];
vector<int> ans;
void reloc() {
  freopen("/Users/admin/Desktop/cards.in", "r", stdin);
  freopen("/Users/admin/Desktop/cards.out", "w", stdout);
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ex[a[i]] = 1;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    k = s - a[i] + 1;
    if (ex[k] == 0) {
      ans.push_back(k);
      ex[k] = 1;
    }
  }
  auto siz = ans.size();
  int t = n - siz;
  t /= 2;
  for (int i = 1; t; i++) {
    if (ex[i]) continue;
    t--;
    ans.push_back(i);
    ans.push_back(s - i + 1);
  }
  printf("%d\n", n);
  for (int i = 0; i <= n - 1; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
