#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, l = 0, k = 0;
  long long m = 0;
  cin >> n;
  while (cin >> n) {
    cin >> l;
    m = l;
    for (int i = 1; i < n; i++) {
      cin >> k;
      m += k;
      l ^= k;
    }
    cout << 2 << endl << l << ' ' << m + l << endl;
  }
}
