#include <bits/stdc++.h>
using namespace std;
int n;
int v[1000010];
vector<int> res;
vector<int> a;
int main() {
  int s = 1000000;
  scanf("%d", &n);
  memset(v, 0, sizeof(v));
  a.clear();
  res.clear();
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    v[x] = 1;
    a.push_back(x);
  }
  int y = 0;
  for (int i = 0; i < n; i++) {
    int x = a[i];
    if (v[s - x + 1] == 1)
      y++;
    else {
      v[s - x + 1] = 2;
      res.push_back(s - x + 1);
    }
  }
  for (int i = 1; i <= s; i++) {
    if (y == 0) break;
    if (v[i] == 0) {
      res.push_back(i);
      res.push_back(s - i + 1);
      v[i] = 2;
      v[s - i + 1] = 2;
      y = y - 2;
    }
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < n; i++) {
    printf("%d ", res[i]);
  }
  printf("\n");
  return 0;
}
