#include <bits/stdc++.h>
using namespace std;
int n, i;
const int N = 1e6 + 5;
int a[N];
vector<int> ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    int first;
    cin >> first;
    a[first] = 1;
  }
  int temp = 1;
  int s = 1000000;
  for (i = 1; i <= s; i++) {
    if (a[i] == 1) {
      if (a[s - i + 1] != 1) {
        ans.push_back(s - i + 1);
      } else {
        a[s - i + 1] = 0;
        while (!(a[temp] == 0 && a[s - temp + 1] == 0)) temp++;
        ans.push_back(temp);
        ans.push_back(s - temp + 1);
        temp++;
      }
    }
  }
  cout << ans.size() << '\n';
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
