#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long x = 0, y = 0;
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      long long tmp;
      scanf("%lld", &tmp);
      x += tmp;
      y ^= tmp;
    }
    long long tar = 0, a = 0, b = 0, c = 0;
    if (x & 1) {
      tar = (1ll << 50) + ((y ^ 1) << 1);
      a = (1ll << 49) | 1;
      b = (tar - x - a) / 2;
      c = b;
      printf("3\n");
      printf("%lld %lld %lld\n", a, b, c);
      assert(x + a + b + c == 2ll * (y ^ a ^ b ^ c));
    } else {
      tar = (1ll << 50) + (y << 1);
      a = (1ll << 49);
      b = (tar - x - a) / 2;
      c = b;
      printf("3\n");
      printf("%lld %lld %lld\n", a, b, c);
      assert(x + a + b + c == 2ll * (y ^ a ^ b ^ c));
    }
  }
  return 0;
}
