#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6, inf = 1e15 + 7;
int n, Arr[N], vis[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> Arr[i], vis[Arr[i]] = 1;
  sort(Arr + 1, Arr + n + 1);
  long long int sum = 0;
  vector<int> res;
  for (int i = 1; i <= n; i++) {
    int a = N - (Arr[i] - 1);
    if (!vis[a])
      res.push_back(a), vis[a] = 1;
    else
      sum += a;
  }
  if (sum == 0) {
    cout << res.size() << "\n";
    sort(res.begin(), res.end());
    for (auto x : res) cout << x << " ";
    cout << "\n";
  } else {
    for (int i = 1; i <= N; i++) {
      if (!vis[i] && !vis[N - i + 1]) {
        res.push_back(i);
        if (res.size() == n) break;
        res.push_back(N - i + 1);
        if (res.size() == n) break;
        vis[i] = vis[N - i + 1] = 1;
      }
    }
    cout << res.size() << "\n";
    sort(res.begin(), res.end());
    for (auto x : res) cout << x << " ";
    cout << "\n";
  }
  return 0;
}
