#include <bits/stdc++.h>
using namespace std;
const int N = 1010100;
int vis[N], n, m;
int main() {
  scanf("%d", &n);
  m = 1000000;
  int d = 0;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    vis[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (vis[i] == 1) {
      if (!vis[m - i + 1]) {
        ans.push_back(m - i + 1);
      } else {
        d++;
      }
      vis[m - i + 1] = -1;
      vis[i] = -1;
    }
  }
  for (int i = 1; i <= m && d; i++) {
    if (vis[i] == 0 && vis[m - i + 1] == 0) {
      d--;
      ans.push_back(i);
      ans.push_back(m - i + 1);
      vis[i] = -1;
      vis[m - i + 1] = -1;
    }
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  puts("");
  return 0;
}
