#include <bits/stdc++.h>
using namespace std;
int n, x, m;
int k[200010];
int main() {
  ios::sync_with_stdio(0);
  int te;
  cin >> te;
  while (te--) {
    cin >> n;
    long long a = 0, b = 0;
    for (int i = 1; i <= n; i++) cin >> k[i], a += k[i], b ^= k[i];
    cout << 2 << " " << b << " " << a + b << "\n";
  }
  return 0;
}
