#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
vector<long long int> v1;
vector<long long int> v2;
const long long int inf = 100000000000005;
bool hs[1000005];
vector<long long int> x, y, re;
long long int n, a, co = 0, si;
const long long int s = 1e6;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(hs, 0, sizeof(hs));
  cin >> n;
  for (int i = 0; i < n; i++) {
    x.push_back(0);
    cin >> x[i];
    hs[x[i]] = 1;
  }
  for (int i = 1; i <= s; i++)
    if (hs[i] == 0 && hs[s - i + 1] == 0) {
      re.push_back(i);
      hs[i] = 1;
    }
  sort(x.begin(), x.end());
  for (int i = 0; i < n; i++) {
    if (hs[s - x[i] + 1] == 0)
      y.push_back(s - x[i] + 1);
    else if (hs[x[i]] != 0) {
      y.push_back(re[co]);
      y.push_back(s - re[co] + 1);
      hs[s - x[i] + 1] = 0;
      co++;
    }
  }
  sort(y.begin(), y.end());
  si = y.size();
  printf("%I64d\n", si);
  for (int i = 0; i < si; i++) printf("%I64d ", y[i]);
  printf("\n");
  return 0;
}
