#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int t, n;
long long a[maxn];
int main() {
  scanf("%d", &t);
  while (t--) {
    long long sum = 0, val = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      sum += a[i];
      val ^= a[i];
    }
    long long d = 2 * val - sum;
    long long p = 1;
    while (p <= sum) p *= 2;
    if (d >= 0) {
      if (sum % 2 == 0) {
        puts("2");
        printf("%lld %lld\n", d / 2, d / 2);
      } else {
        val ^= (p + 1), sum += p + 1;
        d = 2 * val - sum;
        puts("3");
        printf("%lld %lld %lld\n", p + 1, d / 2, d / 2);
      }
    } else {
      if (sum % 2 == 1) {
        val ^= p + 1, sum += p + 1;
        d = 2 * val - sum;
        puts("3");
        printf("%lld %lld %lld\n", p + 1, d / 2, d / 2);
      } else {
        val ^= p, sum += p;
        d = 2 * val - sum;
        puts("3");
        printf("%lld %lld %lld\n", p, d / 2, d / 2);
      }
    }
  }
  return 0;
}
