#include <bits/stdc++.h>
using namespace std;
const int maxn = 10 * 1000 * 100 + 5;
const int mod = 998244353;
int n, a[maxn], mark[maxn], m[maxn], k = 1;
vector<int> ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mark[a[i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (m[a[i]] != 1) {
      if (mark[(int)1e6 + 1 - a[i]] == 0) {
        ans.push_back((int)1e6 + 1 - a[i]);
        m[a[i]] = 1;
        mark[(int)1e6 + 1 - a[i]] = 1;
      } else {
        while (mark[k] == 1 || mark[(int)1e6 + 1 - k] == 1) k++;
        ans.push_back(k);
        ans.push_back((int)1e6 + 1 - k);
        mark[k] = 1;
        mark[(int)1e6 + 1 - k] = 1;
        m[a[i]] = 1;
        m[(int)1e6 + 1 - a[i]] = 1;
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
