#include <bits/stdc++.h>
using namespace std;
struct comprator {
  bool operator()(const pair<int, int>& p1, const pair<int, int>& p2) {
    return p1.first > p2.first;
  }
};
void solve() {
  long long int xx, ss, n;
  xx = 0;
  ss = 0;
  cin >> n;
  for (long long int i = 0; i < n; ++i) {
    long long int val;
    cin >> val;
    xx = xx ^ val;
    ss = ss + val;
  }
  long long int n1 = 0, n2 = 0, n3 = 0;
  long long int x;
  if (ss % 2)
    x = 100000000000000000 - 1;
  else
    x = 100000000000000000;
  n1 = x;
  long long int temp = 2;
  n2 = n3 = (2 * (xx ^ x) - ss - x) / 2;
  cout << 3 << "\n" << n1 << " " << n2 << " " << n3 << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
