#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void CI(int &_x) { scanf("%d", &_x); }
void CO(int &_x) { cout << _x; }
template <typename T>
void getarray(T a[], int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename T>
void printarray(T a[], int n) {
  for (int i = 0; i < n - 1; i++) cout << a[i] << " ";
  cout << a[n - 1] << endl;
}
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
int dr8[8] = {1, -1, 0, 0, 1, -1, -1, 1};
int dc8[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dr4[4] = {0, 0, 1, -1};
int dc4[4] = {-1, 1, 0, 0};
int kn8r[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int kn8c[8] = {2, 1, -1, -2, -2, -1, 1, 2};
bool have[1000000 + 5];
int main() {
  int n, temp;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    CI(temp);
    have[temp] = 1;
  }
  int cnt = 0;
  vector<int> res;
  for (int i = 1; i <= 1000000; i++)
    if (have[i]) {
      if (have[1000000 - i + 1] == 0) {
        res.push_back(1000000 - i + 1);
      } else {
        cnt++;
        have[1000000 - i + 1] = 0;
      }
    }
  for (int i = 1; i <= 1000000; i++)
    if (have[i] == 0 && have[1000000 - i + 1] == 0 && cnt) {
      cnt--;
      res.push_back(i);
      res.push_back(1000000 - i + 1);
    }
  sort(res.begin(), res.end());
  cout << res.size() << "\n";
  for (int i = 0; i < res.size(); i++) cout << res[i] << " ";
  puts("\n");
}
