#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9;
const int MAXN = 1e6 + 10;
int ar[MAXN];
int n;
int main() {
  scanf(" %d", &n);
  int a;
  for (int(i) = (1); (i) <= (n); (i)++) {
    scanf(" %d", &a);
    ar[a] = 1;
  }
  int cnt = 0;
  int s = 1e6, size = 0;
  for (int(i) = (1); (i) <= (s); (i)++)
    if (ar[i] == 1 && ar[s - i + 1] == 0)
      ar[s - i + 1] = 2, size++;
    else if (ar[i] == 1 && ar[s - i + 1] == 1)
      cnt++;
  cnt /= 2;
  for (int(i) = (1); (i) <= (s); (i)++)
    if (cnt && ar[i] == 0 && ar[s - i + 1] == 0)
      ar[i] = ar[s - i + 1] = 2, size += 2, cnt--;
  cout << size << endl;
  for (int(i) = (1); (i) <= (s); (i)++)
    if (ar[i] == 2) printf("%d ", i);
  cout << endl;
  return 0;
}
