#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long LINF = 2e18;
void inv(bool e);
template <typename T>
void die(T& a);
bool brute, alter;
int cnt_tests = 1;
int n;
vector<int> arr;
void inp() {
  cin >> n;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr.push_back(x);
  }
}
const int MAX = 1e6;
bool used[MAX + 10], used2[MAX + 10];
void solve() {
  for (auto x : arr) {
    used[x] = 1;
  }
  vector<int> ans;
  int p = 1;
  for (auto x : arr) {
    if (!used[MAX - x + 1]) {
      ans.push_back(MAX - x + 1);
    } else {
      if (!used2[x]) {
        while (used[p] || used[MAX - p + 1]) {
          p++;
        }
        ans.push_back(p);
        ans.push_back(MAX - p + 1);
        used2[MAX - x + 1] = 1;
        p++;
      }
    }
  }
  cout << ((int)(ans).size()) << '\n';
  long long check = 0ll;
  for (auto x : ans) {
    cout << x << ' ';
    check += MAX - x;
  }
  cerr << '\n' << check;
}
void stress() {}
void naive() {}
void run();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (0) {
    freopen("stack.in", "r", stdin);
    freopen("stack.out", "w", stdout);
  }
  brute = false;
  for (int i = 0; (i < cnt_tests); i++) {
    run();
  }
  cerr << '\n' << "Time: " << clock() / 1000.0 << " ms";
  return 0;
}
void run() {
  if (!brute) {
    inp();
  } else {
    stress();
  }
  solve();
}
template <typename T>
void die(T& a) {
  cout << a;
  exit(0);
}
void inv(bool e) {
  if (!e) {
    vector<int> a;
    a[-1] += 1;
  }
}
