#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
string str = "";
long double distance(long double x1, long double y1, long double x2,
                     long double y2) {
  long double ans = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return ans;
}
void run() {
  cin >> n;
  long long s = 1000000;
  long long sum = 0;
  bool left[s];
  memset(left, true, sizeof(left));
  long long nums[n];
  for (long long int i = 0; i < n; i++) {
    cin >> nums[i];
    sum += nums[i] - 1;
    left[nums[i] - 1] = false;
  }
  bool chosen[s];
  memset(chosen, false, sizeof(chosen));
  int countpairs = 0;
  int truetrue = 0;
  int count = 0;
  for (long long int i = 0; i < s; i++) {
    if (!left[i]) {
      if (!left[s - i - 1]) {
        countpairs++;
      } else {
        chosen[s - i - 1] = true;
        count++;
      }
    } else if (left[s - i - 1]) {
      truetrue += 1;
    }
  }
  int i = 0;
  while (countpairs > 0 && i < s) {
    if (left[i] && left[s - i - 1]) {
      chosen[i] = chosen[s - i - 1] = true;
      count += 2;
      countpairs -= 2;
    }
    i++;
  }
  cout << setprecision(30) << count << '\n';
  ;
  for (long long int i = 0; i < s; i++) {
    if (chosen[i]) {
      cout << setprecision(30) << i + 1 << " ";
      ;
    }
  }
}
void setup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
}
int main() {
  setup();
  int tests = 1;
  for (int i = 0; i < tests; i++) {
    run();
  }
  return 0;
}
