#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int arr[1000001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (auto i = 0; i < (long long)(n); i++) {
    int x;
    cin >> x;
    arr[x] = 1;
  }
  vector<int> vec;
  for (auto i = 1; i <= (long long)(N); i++)
    if (arr[i] && !arr[N - i + 1]) vec.push_back(N - i + 1);
  for (auto i = 1; i <= (long long)(N); i++) {
    if (((int)((vec).size())) == n) break;
    if (!arr[i] && !arr[N - i + 1]) {
      vec.push_back(i);
      vec.push_back(N - i + 1);
    }
  }
  cout << ((int)((vec).size())) << '\n';
  for (auto i : vec) cout << i << " ";
  return 0;
}
