#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int S = 1e6;
int ss[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int inp;
    cin >> inp;
    ss[inp] = 1;
  }
  int pairs = 0;
  vector<int> ans;
  for (int i = 1; i <= S; i++) {
    if (i <= S / 2 && ss[i] == 1 && ss[S - i + 1] == 1) pairs++;
    if (ss[i] == 1 && ss[S - i + 1] == 0) ans.push_back(S - i + 1);
  }
  for (int i = 1; i <= S / 2 && pairs > 0; i++) {
    if (ss[i] == 0 && ss[S - i + 1] == 0)
      ans.push_back(i), ans.push_back(S - i + 1), pairs--;
  }
  cout << ans.size() << "\n";
  for (int i : ans) cout << i << " ";
  cout << "\n";
  return 0;
}
