#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s+=1;
            s1=s1^1;
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s>s1*2){
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p+1;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n'<<'\n';return;
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s+=1;
            s1=s1^1;
            if(s1*2>s){
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;}
            else{
                s+=p;
                s1=s1^p;
                b=s1*2-s;
                cout<<3<<'\n';
                cout<<p+1<<" "<<b/2<<" "<<b/2;
            }
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    else{
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p+1;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n'<<'\n';return;
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s+=1;
            s1=s1^1;
            if(s1*2>s){
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;}
            else{
                b=s-s1*2;
                cout<<3<<'\n';
                cout<<1<<" "<<b/2<<" "<<b/2;
            }
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    else{
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p+1;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s+=1;
            s1=s1^1;
            if(s1*2>s){
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;}
            else{
                b=s-s1*2;
                cout<<3<<'\n';
                cout<<1<<" "<<b/2<<" "<<b/2;
            }
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    else{
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p+1;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            cout<<3<<'\n';
            cout<<1<<" "<<(b-1)/2<<" "<<(b-1)/2;
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    if(s>s1*2){
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=pow(2,50)+1;
            s1=s1^c;
            s=s+pow(2,50)-1;
            b=s1*2-s;
            cout<<pow(2,50)+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=pow(2,50);
            s1=s1^c;
            s+=pow(2,50);
            b=s1*2-s;
            cout<<pow(2,50)<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s-=1;
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s>s1*2){
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p-1;
            b=s1*2-s;
            cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            s-=1;
            cout<<3<<'\n';
            b=s1*2-s;
            cout<<1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s>s1*2){
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p-1;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            ///cout<<b<<'\n';
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/

#define pb              push_back
#define ll              long long
#define str             string
#define fi              first
#define se              second
#define for0(i, n)      for (ll i = 0; i < n; ++i)
#define for1(i, n)      for (ll i = 1; i <= n;++i)
#define for2(i, n)      for (ll i = 1; i < n; ++i)
#define for3(i, k, n)   for (ll i = k; i < n; ++i)
#define all(c)          (c).begin(),(c).end()

#define R cin>>
#define ln cout<<'\n'

#define fori(itt, stt)  for(itt = stt.begin(); itt != stt.end(); ++itt)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define ld              long double
//КТУ(A,B)=__gcd(A,B);

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll   INF = 1e18;
const ll SIZE = 5e4+5;
const ll  mod = 998244353;

void solve(){
    ll n,k1,k2;
    cin>>n;
    vector<ll>a(n);
    ll s=0,s1=0;

    for0(i,n){
        cin>>a[i];
        s1=s1^a[i];
        s+=a[i];
    }
    if(s1*2==s){
        cout<<0<<'\n';
    }
    if(s1*2>s){
        ll b=s1*2-s;
        if(b%2==1){
            cout<<3<<'\n';
            cout<<1<<" "<<(b-1)/2<<" "<<(b-1)/2;
        }
        else{
            cout<<2<<'\n';
            cout<<b/2<<" "<<b/2;
        }
    }
    ll p=1;
    for(ll i=0;i<50;++i)p*=2;
    if(s>s1*2){
        ll b=s-s1*2;
        if(b%2==1){
            cout<<3<<'\n';
            ll c=p+1;
            s1=s1^c;
            s=s+p-1;
            b=s1*2-s;
            cout<<p+1<<" "<<b/2<<" "<<b/2;
        }
        else{
            cout<<3<<'\n';
            ll c=p;
            s1=s1^c;
            s+=p;
            b=s1*2-s;
            cout<<p<<" "<<b/2<<" "<<b/2;
        }
    }

    cout<<'\n';
}

int main() {
    ll t=1;
    cin>>t;
    for1(www,t) solve();
    return 0;}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(xorv!=0){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0 && diffv>0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                for(ll i=1;i<100000000000;i++){
                    ll sum2 = sumv + i;
                    if(sum2==2*(xorv^i)){
                        cnt = 1;
                        val = i;
                        break;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else if(xorv==0){
            cnt = 1;
            ll val = sumv;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cout<<0<<endl;
            cout<<endl;
        }
        else{
            cout<<2<<endl;
            cout<<xorv<<" "<<sumv+xorv<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(2*xorv > sumv){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                for(ll i=1;i<10000000000;i+=2){
                    ll sum2 = sumv + i;
                    if(sum2==2*(xorv^i)){
                        cnt = 1;
                        val = i;
                        break;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else{
            cnt = 3;
            ll val = sumv + 2;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<" "<<1<<" "<<1<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(2*xorv > sumv){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                for(ll i=1;i<10000000000;i+=2){
                    ll sum2 = sumv + i;
                    if(sum2==2*(xorv^i)){
                        cnt = 1;
                        val = i;
                        break;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else{
            cnt = 1;
            ll val = sumv;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cout<<0<<endl;
            cout<<endl;
        }
        else{
            cout<<2<<endl;
            cout<<sumv<<" "<<sumv+xorv<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(xorv!=0){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0 && diffv>0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                if(sumv%2==0){
                    for(ll i=0;i<100000000000;){
                        ll sum2 = sumv + i;
                        if(sum2==2*(xorv^i)){
                            cnt = 1;
                            val = i;
                            break;
                        }
                        i += 2;
                    }
                }
                else{
                    for(ll i=1;i<100000000000;){
                        ll sum2 = sumv + i;
                        if(sum2==2*(xorv^i)){
                            cnt = 1;
                            val = i;
                            break;
                        }
                        i += 2;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else if(xorv==0){
            cnt = 1;
            ll val = sumv;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(xorv!=0){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                for(ll i=1;i<10000000000;i+=2){
                    ll sum2 = sumv + i;
                    if(sum2==2*(xorv^i)){
                        cnt = 1;
                        val = i;
                        break;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else if(xorv==0){
            cnt = 1;
            ll val = sumv;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(2*xorv > sumv){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
        }
        else{
            cnt = 3;
            ll val = sumv + 2;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<" "<<1<<" "<<1<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull long long int

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        ll a[n];
        ll sumv = 0;
        ll xorv = 0;
        int cnt = 0;
        vector<ll> values;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sumv += a[i];
            xorv ^= a[i];
        }
        if(sumv==2*xorv){
            cnt = 0;
            cout<<0<<endl;
            cout<<endl;
        }
        else if(xorv!=0){
            ll diffv = 2*xorv - sumv;
            if(diffv%2==0 && diffv>0){
                cnt = 2;
                ll val = diffv/2;
                cout<<cnt<<endl;
                cout<<val<<" "<<val<<endl;
            }
            else{
                ll val;
                if(sumv%2==0){
                    for(ll i=1;i<100000000000;){
                        ll sum2 = sumv + i;
                        if(sum2==2*(xorv^i)){
                            cnt = 1;
                            val = i;
                            break;
                        }
                        i += 2;
                    }
                }
                else{
                    for(ll i=0;i<100000000000;){
                        ll sum2 = sumv + i;
                        if(sum2==2*(xorv^i)){
                            cnt = 1;
                            val = i;
                            break;
                        }
                        i += 2;
                    }
                }
                cout<<cnt<<endl;
                cout<<val<<endl;
            }
        }
        else if(xorv==0){
            cnt = 1;
            ll val = sumv;
           // values.push_back(val);
            cout<<cnt<<endl;
            cout<<val<<endl;
        }
    }
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1 ) > 0 ) {
        ++ sm ; x ^= 1 ;
        ans[ 2 ] = 1 ;
    }
    if ( x == 0 ) {
        sm += 2 ;
        x ^= 2 ;
        ans[ 2 ] += 2 ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 58 ; ++ i ) {
        auto ret1 = ( sm & pw1 ) ;
        auto ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        pw1 = pw1 * 2 ;
        pw2 = pw2 * 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1 ) > 0 ) {
        ++ sm , x ^= 1 ;
        ans[ 2 ] = 1 ;
    }
    if ( x == 0 ) {
        sm += 2 ;
        x ^= 2 ;
        ans[ 2 ] ^= 2 ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 58 ; ++ i ) {
        unsigned long long ret1 = ( sm & pw1 ) ;
        unsigned long long ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        pw1 *= 2 ;
        pw2 *= 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    cout << "3\n" ;
    cout << x << " " << sm + x << " 0\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
long long a[ MAXN ] ;

long long ans[ 5 ] ;

long long sm , x ;

void input ( ) {
    scanf ( "%d" , &n ) ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        scanf ( "%I64d" , &a[ i ] ) ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1LL ) > 0 ) {
        ++ sm , x ^= 1LL ;
        ans[ 2 ] = 1LL ;
    }
    if ( x == 0 ) {
        sm += 2LL ;
        x ^= 2LL ;
        ans[ 2 ] ^= 2LL ;
    }
    for ( int i = 1 ; i <= 60 ; ++ i ) {
        long long pw1 = ((1LL)<<i) ;
        long long pw2 = ((1LL)<<(i-1)) ;
        long long ret1 = ( sm & pw1 ) ;
        long long ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
    }
    printf ( "3\n" ) ;
    printf ( "%I64d %I64d %I64d\n" , ans[ 0 ] , ans[ 1 ] , ans[ 2 ] ) ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    scanf ( "%d" , &t ) ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;

    if ( ( sm & 1 ) > 0 ) {
        cout << "3\n" ;
        cout << sm << " " << 2 * sm << " 0\n" ;
        return ;
    }
    if ( x == 0 ) {
        cout << "3\n" ;
        cout << sm << " 0 0\n" ;
        return ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 50 ; ++ i ) {
        unsigned long long ret1 = ( sm & pw1 ) ;
        unsigned long long ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        pw1 = pw1 * 2 ;
        pw2 = pw2 * 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1 ) > 0 ) {
        cout << "3\n" ;
        cout << x << " " << sm + x << " 0\n" ;
        return ;
    }
    if ( x == 0 ) {
        cout << "3\n" ;
        cout << sm << " 0 0\n" ;
        return ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 58 ; ++ i ) {
        unsigned long long ret1 = ( sm & pw1 ) ;
        unsigned long long ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        pw1 = pw1 * 2 ;
        pw2 = pw2 * 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1LL ) > 0 ) {
        ++ sm , x ^= 1LL ;
        ans[ 2 ] = 1LL ;
    }
    if ( x == 0 ) {
        sm += 2LL ;
        x ^= 2LL ;
        ans[ 2 ] ^= 2LL ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 58 ; ++ i ) {
        unsigned long long ret1 = ( long long )( sm & pw1 ) ;
        unsigned long long ret2 = ( long long )( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        pw1 *= 2 ;
        pw2 *= 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    scanf ( "%d" , &t ) ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( x == 0 ) {
        cout << "3\n" ;
        cout << sm << " 0 0\n" ;
        return ;
    }
    if ( ( sm & 1 ) > 0 ) {
        ++ sm ; x ^= 1 ;
        ans[ 2 ] = 1 ;
    }

    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 50 ; ++ i ) {
        unsigned long long ret1 = ( sm & pw1 ) ;
        unsigned long long ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += pw1 ;
        }
        pw1 = pw1 * 2 ;
        pw2 = pw2 * 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 100007

int n ;
unsigned long long a[ MAXN ] ;

unsigned long long ans[ 5 ] ;

unsigned long long sm , x ;

void input ( ) {
    cin >> n ;
    sm = x = 0 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        sm += a[ i ] ;
        x ^= a[ i ] ;
    }
}

void solve ( ) {
    ans[ 0 ] = ans[ 1 ] = ans[ 2 ] = 0 ;
    if ( ( sm & 1 ) > 0 ) {
        ++ sm ; x ^= 1 ;
        ans[ 2 ] = 1 ;
    }
    if ( x == 0 ) {
        sm += 2 ;
        x ^= 2 ;
        ans[ 2 ] += 2 ;
    }
    unsigned long long pw1 = 2 ;
    unsigned long long pw2 = 1 ;
    for ( long long i = 1 ; i <= 58 ; ++ i ) {
        auto ret1 = ( sm & pw1 ) ;
        auto ret2 = ( x & pw2 ) ;
        if ( ret1 == 0 && ret2 != 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        if ( ret1 != 0 && ret2 == 0 ) {
            ans[ 0 ] += pw2 ;
            ans[ 1 ] += pw2 ;
            sm += 2 * pw2 ;
        }
        pw1 *= 2 ;
        pw2 *= 2 ;
    }
    cout << "3\n" ;
    cout << ans[ 0 ] << " " << ans[ 1 ] << " " << ans[ 2 ] << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

ll a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        long long n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored != 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                long long x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 1;
                xored ^= 1;
                ll x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 1 << '\n';
            }
        }
    }
    return 0;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

ll a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        long long n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored != 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                long long x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 100000000000000001;
                xored ^= 100000000000000001;
                ll x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 100000000000000001 << '\n';
            }
        }
    }
    return 0;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

int a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        int n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored > 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                int x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 1;
                xored ^= 1;
                int x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 1 << '\n';
            }
        }
    }
    return 0;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

ll a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        long long n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored != 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                long long x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 1e9 + 1;
                xored ^= int(1e9 + 1);
                ll x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 1 << '\n';
            }
        }
    }
    return 0;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

ll a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        unsigned long long n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored != 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                unsigned long long x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 1;
                xored ^= 1;
                unsigned long long x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 1 << '\n';
            }
        }
    }
    return 0;
}


#include <iostream>
#include <cmath>
typedef long long ll;

using namespace std;

int a[100005];

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 0;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        unsigned int n, sum = 0, xored = 0;
        cin >> n;
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
            sum += a[j];
            xored ^= a[j];
        }
        if ((sum == 2 * (xored) && xored != 0) || (sum == 0 && xored == 0)) cout << "0\n\n";
        else if (xored == 0)
        {
            cout << "1\n2\n";
        }
        else
        {
            if (sum % 2 == 0)
            {
                int x = xored - sum / 2;
                cout << "2\n" << x << ' ' << x << '\n';
            }
            else
            {
                sum += 1;
                xored ^= 1;
                int x = xored - sum / 2;
                cout << "3\n" << x << ' ' << x << ' ' << 1 << '\n';
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    ll res = 0;
    int carry = 0, e = 0;

    for (int i = 0; carry || i < 32 || e; ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j)
            sum += (a[j] >> i) & 1;
        if ((sum + carry) % 2 != e) {
            res |= 1LL << i;
            sum++;
        }
        e = sum & 1;
        carry = (sum + carry) >> 1;
    }
    cout << "1\n" << res << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;

    ll xo  = 0, sum = 0;
    for(int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        sum += x;
        xo ^= x;
    }
    cout << "2\n" << xo << ' ' << sum + xo << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    ll res = 0;
    int carry = 0, e = 0;

    for (int i = 0; carry || i < 32 || e; ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j)
            sum += (a[j] & (1LL << i)) != 0;
        if ((sum + carry) % 2 != e) {
            res |= 1LL << i;
            sum++;
        }
        e = sum & 1;
        carry >>= 1;
    }
    cout << "1\n" << res << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    ll res = 0;
    int carry = 0, e = 0;

    for (int i = 0; carry || i < 32; ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j)
            sum += (a[j] & (1LL << i)) != 0;
        if ((sum + carry) % 2 != e) {
            res |= 1LL << i;
            sum++;
        }
        e = sum & 1;
        carry >>= 1;
    }
    cout << "1\n" << res << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    ll res1, res2, res3 = 0;
    int carry = 0, e = 0;

    for (int i = 0; carry || i < 32 || e; ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j)
            sum += (a[j] >> i) & 1;
        if(!sum && !carry && e ) {
            res1 |= 1LL << i;
            res2 |= 1LL << i;
            res3 |= 1LL << i;
            sum += 3;
        }
        else if ((sum + carry) % 2 != e) {
            res1 |= 1LL << i;
            sum++;
        }
        e = sum & 1;
        carry = (sum + carry) >> 1;
    }
    cout << "3\n" << res1 << ' ' << res2 << ' ' << res3 << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;

const int MxN = (int) 1e5 + 9;
int a[MxN + 9];

void f() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    ll res1=0, res2=0, res3 = 0;
    int carry = 0, e = 0;

    for (int i = 0; carry || i < 32 || e; ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j)
            sum += (a[j] >> i) & 1;
        if(!sum && !carry && e ) {
            res1 |= 1LL << i;
            res2 |= 1LL << i;
            res3 |= 1LL << i;
            sum += 3;
        }
        else if ((sum + carry) % 2 != e) {
            res1 |= 1LL << i;
            sum++;
        }
        e = sum & 1;
        carry = (sum + carry) >> 1;
    }
    cout << "3\n" << res1 << ' ' << res2 << ' ' << res3 << '\n';
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int _t;
    cin >> _t;
    while (_t--)
        f();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
      //  sum = 25;
      //  txor = 30;
      //  cout << sum << "*" << txor << endl;
      if (txor == 1){
        cout << 2 << endl;
        cout << txor << " " << sum+txor;
      } else {
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum  ){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                if (txor%2==0){
                cout << 3 << endl;
                cout << 1 << " " << ((txor+1)*2-sum-1)/2 << " " << ((txor+1)*2-sum-1)/2;
                } else
                    if (txor%2==1){
                        cout << 3 << endl;
                        cout << 1 << " " << ((txor-1)*2 - sum - 1)/2 << " " << ((txor-1)*2 - sum - 1)/2;
                    }
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
      }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        long long x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
        if (txor * 2==sum) {cout << 0 << endl;} else {
        if (txor == 0){
                cout << 1 << endl;
                cout << sum;
        } else
            {
                cout << 2 << endl;
                cout << txor << " " << (sum+txor);
            }
        }
        cout << endl;
   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
      //  sum = 25;
      //  txor = 30;
      //  cout << sum << "*" << txor << endl;
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                if (txor%2==0){
                cout << 3 << endl;
                cout << 1 << " " << ((txor+1)*2-sum-1)/2 << " " << ((txor+1)*2-sum-1)/2;
                } else
                    if (txor%2==1){
                        cout << 3 << endl;
                        cout << 1 << " " << ((txor-1)*2 - sum - 1)/2 << " " << ((txor-1)*2 - sum - 1)/2;
                    }
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
      //  sum = 25;
      //  txor = 30;
      //  cout << sum << "*" << txor << endl;
      if (sum==1 && txor == 1){
        cout << 2 << endl;
        cout << txor << " " << sum+txor;
      } else {
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum  ){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                if (txor%2==0){
                cout << 3 << endl;
                cout << 1 << " " << ((txor+1)*2-sum-1)/2 << " " << ((txor+1)*2-sum-1)/2;
                } else
                    if (txor%2==1){
                        cout << 3 << endl;
                        cout << 1 << " " << ((txor-1)*2 - sum - 1)/2 << " " << ((txor-1)*2 - sum - 1)/2;
                    }
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
      }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
        cout << sum << "*" << txor << endl;
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                if (txor%2==0){
                cout << 3 << endl;
                cout << 1 << " " << (txor*2-sum-1)/2 << " " << (txor*2-sum-1)/2;
                } else
                    if (txor%2==1){
                        cout << 3 << endl;
                        cout << 1 << " " << ((txor-1)*2 - sum - 1)/2 << " " << ((txor-1)*2 - sum - 1)/2;
                    }
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        long long x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
    //    sum = 514123;
    //    txor =564;
    //    cout << sum << "*" << txor << endl;
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor == 0){cout << 1 << endl;cout << sum;} else
            {
                cout << 2 << endl;
                cout << txor << " " << (sum+txor);
            }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                cout << 3 << endl;
                cout << 1 << " " << (txor*2-sum-1)/2 << " " << (txor*2-sum-1)/2;
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
        cout << endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int n,t;
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   cin >> t;
   while(t>0){
        cin >> n;
        t--;
        long long sum = 0;
        long long txor = 0;
        int x;
        for(int i=1;i<=n;i++){
            cin >> x;
            sum += x;
            txor ^= x;
        }
      //  cout << sum << "*" << txor << endl;
        if (txor * 2==sum) {cout << 0 << endl;}
        if (txor * 2 > sum){
            if (sum%2==0){
                cout << 2 << endl;
                cout << (txor*2-sum)/2 << " " << (txor*2-sum)/2;
            } else {
                if (txor%2==0){
                cout << 3 << endl;
                cout << 1 << " " << (txor*2-sum-1)/2 << " " << (txor*2-sum-1)/2;
                } else
                    if (txor%2==1){
                        cout << 3 << endl;
                        cout << 1 << " " << ((txor-1)*2 - sum - 1)/2 << " " << ((txor-1)*2 - sum - 1)/2;
                    }
            }
        }
        if (txor*2 < sum){
            cout << 2 << endl;
            cout << txor << " " << sum+txor;
        }
        cout << endl;

   }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        int n,x;
        ll sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<xr<<" "<<sum+xr<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        int n,x,sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<x<<" "<<sum+x<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        int n,x,sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<x<<" "<<sum<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        int n,x,sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<xr<<" "<<sum+xr<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        int n,x;
        long long sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<xr<<" "<<sum+xr<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        ll n,x,sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<xr<<" "<<sum+xr<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endll "\n"
#define show(a) cerr<<""#a""<<" is "<<a<<endll;
int caseno=0;
#define print_case cout<<"Case "<<++caseno<<": ";
#define fout freopen("output.txt","w",stdout);
#define fin freopen("input.txt","r",stdin);
#define srt(v) sort(v.begin(),v.end());
#define greatersrt(v) sort(v.begin(),v.end(),greater<ll>())
#define pb push_back
#define mp make_pair
#define here cerr<<"here\n";
#define PI acos(-1.0)
//#define ll long long
#define ld long double
#define reto exit(0);
#define sspace <<" "<<
#define print(arr) for(int i=1;i<=n;i++)cout<<arr[i]<<" \n"[i==n];
bool sortbysec(pair<int,int>a,pair<int,int>b){return a.second>b.second;}
//ll gc(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
//ll lc(ll a,ll b){return a/gc(a,b)*b;}
const int primemod=1e9+7;
const ld eps=1e-9;
#define inl(x) scanf("%lld",&x)
#define in(x) scanf("%d",&x)
/**Code Goes Here**/

int main()
{
    int T;
    in(T);
    while(T--){
        long long n,x,sum=0,xr=0;
        in(n);
        while(n--){
            in(x);
            sum+=x;
            xr^=x;
        }
        cout<<2<<endl<<xr<<" "<<sum+xr<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

int t;
int ans;
int X;

int main(){
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        int a[101010];
        for(int i = 1;n >= i;i++){
            cin >> a[i];
            ans += a[i];
            X ^= (a[i]);
        }
        cout<<2<<endl;
        cout<<X<<" "<<ans<<endl;
        X = 0;
        ans = 0;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int t;
long long  ans;
long long  X;

int main(){
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        int a[101010];
        for(int i = 1;n >= i;i++){
            cin >> a[i];
            ans += a[i];
            X ^= (a[i]);
        }
        if(X * 2 == ans)
        {
            cout<<0<<endl<<endl;
        }

        else{
            ans += X;
        cout<<2<<endl;
        cout<<X<<" "<<ans<<endl;
        }
        X = 0;
        ans = 0;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int t;
int ans;
int X;

int main(){
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        int a[101010];
        for(int i = 1;n >= i;i++){
            cin >> a[i];
            ans += a[i];
            X ^= (a[i]);
        }
        if(X * 2 == ans)
        {
            cout<<0<<endl<<endl;
        }
        else{cout<<2<<endl;
        cout<<X<<" "<<ans<<endl;}
        X = 0;
        ans = 0;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int t;
int ans;
int X;

int main(){
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        int a[101010];
        for(int i = 1;n >= i;i++){
            cin >> a[i];
            ans += a[i];
            X ^= (a[i]);
        }
        if(X * 2 == ans)
        {
            cout<<0<<endl<<endl;
        }

        else{
            ans += X;
        cout<<2<<endl;
        cout<<X<<" "<<ans<<endl;
        }
        X = 0;
        ans = 0;
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(long long sum, long long currentXor, vector<long long>& pref) {
    if (abs(sum - 2 * currentXor) > 100) {
        return false;
    }
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (long long n = (pref.empty() ? 1 : pref.back()); n <= 100 * sum; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<long long> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(long long sum, long long currentXor, vector<long long>& pref) {
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (long long n = 1; n <= 1000000000000000000; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<long long> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <iostream>

using namespace std;

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        cout << 2 << '\n' << currentXor << ' ' << sum + currentXor << '\n';
    }
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(long long sum, long long currentXor, vector<long long>& pref) {
    if (abs(sum - 2 * currentXor) > 2 * sum) {
        return false;
    }
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (long long n = (pref.empty() ? 1 : pref.back()); n <= 100 * sum; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<long long> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(int sum, int currentXor, vector<int>& pref) {
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (int n = 1; n <= 2 * sum; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        int sum = 0;
        int currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<int> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <iostream>

using namespace std;

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        cout << currentXor << ' ' << sum + currentXor << '\n';
    }
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(int sum, int currentXor, vector<int>& pref) {
    if (abs(sum - 2 * currentXor) >= 100) {
        return false;
    }
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (int n = 1; n <= 2 * sum; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        int sum = 0;
        int currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<int> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <iostream>
#include <vector>

using namespace std;

bool DFS(long long sum, long long currentXor, vector<long long>& pref) {
    if (abs(sum - 2 * currentXor) > 100) {
        return false;
    }
    if (sum == 2 * currentXor) {
        return true;
    }
    if (pref.size() < 3) {
        for (long long n = (pref.empty() ? 1 : pref.back()); n <= 2 * sum; ++n) {
            pref.push_back(n);
            if (DFS(sum + n, currentXor ^ n, pref)) {
                return true;
            }
            pref.pop_back();
        }
    }
    return false;
}

int main() {
    int t, number;
    cin >> t;
    while (t--) {
        long long sum = 0;
        long long currentXor = 0;
        int n;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> number;
            currentXor = currentXor ^ number;
            sum += number;
        }
        vector<long long> pref;
        if (DFS(sum, currentXor, pref)) {
            cout << pref.size() << '\n';
            for (int i : pref) {
                cout << i << ' ';
            }
            cout << '\n';
        } else {
            cout << "WENT WRONG\n";
        }
    }
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            a.push_back(u);
            sum+=u;
            u^=2;
            a.push_back(sum/2);
            a.push_back(sum/2);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
            else{
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            a.push_back(u);
            sum+=u;
            u^=u;
            a.push_back(sum);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                u^=1;
            }
        if(u*2 < sum){
            a.push_back(u);
            sum+=u;
            u^=u;
            a.push_back(sum);
        }
        else{
            a.push_back((u*2 -sum)/2);
            a.push_back((u*2 -sum)/2);
        }
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            a.push_back(u);
            sum+=u;
            u^=u;
            a.push_back(sum);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                u^=1;
            }
                a.push_back(sum/2);
                a.push_back(sum/2);
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(sum%2!=0){
            if(u*2 < sum){
               u^=(ll) 1e10+1;
                sum+=1e10+1;
                a.push_back(1e10+1);
            }
            else{
                a.push_back(1);
                sum++;
                u^=1;
            }
        }
        if(u*2 < sum){
            u^=(ll) 1e10;
            sum+=1e10;
            a.push_back(1e10);
        }
        if(u*2 > sum){
            ll cur = u*2 - sum;
            a.push_back(cur/2);
            a.push_back(cur/2);
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            if(u>0)
            a.push_back(u);
            sum+=u;
            u^=u;
            a.push_back(sum);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
            else{
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            a.push_back(u);
            sum+=u;
            u^=u;
            a.push_back(sum);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                u^=1;

            }
                a.push_back((u*2 -sum)/2);
                a.push_back((u*2 -sum)/2);
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(u*2 < sum){
            if(u>0)
            a.push_back(u);
            sum+=u;
            u^=2;
            a.push_back(sum/2);
            a.push_back(sum/2);
        }
        else if(u*2 > sum){
            if(sum%2!=0){
                a.push_back(1);
                sum++;
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
            else{
                a.push_back(sum/2);
                a.push_back(sum/2);
            }
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))

using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

double dis(int x,int y,int a,int b){
    double u1 = a-x;
    u1*=u1;
    double u2 = b-y;
    u2*=u2;
    double ans=u1+u2;
    return sqrt(ans);
}

vector<ll>a;

int main()
{
    weewoo;
    ll t;cin >> t;
    while(t--){
        ll n;cin >> n;
        ll u;
        cin >> u;
        ll sum = u;
        for(int i = 1;i<n;i++){
            ll x;cin >> x;
            u^=x;
            sum+=x;
        }
        if(sum%2!=0){
            if((u^1)*2 <= sum){
               u^=(ll) 1e10+1;
                sum+=1e10+1;
                a.push_back(1e10+1);
            }
            else{
                a.push_back(1);
                sum++;
                u^=1;
            }
        }
        if(u*2 < sum){
            u^=(ll) 1e10;
            sum+=1e10;
            a.push_back(1e10);
        }
        if(u*2 > sum){
            ll cur = u*2 - sum;
            a.push_back(cur/2);
            a.push_back(cur/2);
        }
        cout << a.size() << endl;
        for(int i=0;i<a.size();i++){
            cout << a[i];
            if(i<a.size()-1)
                cout << " ";
        }
        cout << endl;
            a.clear();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void go() {
    int n;
    scanf("%d", &n);
    ll sm = 0, x = 0;
    ll d;
    for (int i = 0; i < n; ++i) {
        scanf("%lld", &d);
        sm += d;
        x ^= d;
    }
    if (sm == x<<1) {
        puts("0");
        return;
    }
    printf("2\n%lld %lld\n", x, sm+x);
}
int main() {
    int t;
    scanf("%d", &t);
    while (t--) {
        go();
    }
    return 0;
}


/*****Because Its Christmas******/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back
#define mp                make_pair
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end())
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
        lld t; cin>>t;
        while(t--){
         lld n; cin>>n;
         pls(n,a);
         lld xr=a[0];
         itr(i,1,n-1)  xr=xr^a[i];
         lld sum=accumulate(a,a+n,0);
       if(sum==2*xr){ cout<<0<<nl<<nl; continue;}
       else if((sum%2==0&&xr%2==0)||(sum%2!=0&&xr%2==0)){
           lld fctr=1;
               lld ans=(fctr*sum)^xr;
                   cout<<3<<nl;
                   lld bb=fctr*sum-ans;
                   cout<<ans<<" "<<bb/2<<" "<<bb/2<<nl;

           }
         else{
               lld ans=(sum+1)^xr;
                   cout<<3<<nl;
                   lld bb=sum+1-ans;
                   cout<<ans<<" "<<bb/2<<" "<<bb/2<<nl;
                    }

        }
}


/*****Because Its Christmas******/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back
#define mp                make_pair
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end())
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
        lld t; cin>>t;
        while(t--){
         lld n; cin>>n;
         pls(n,a);
         lld xr=a[0];
         itr(i,1,n-1)  xr=xr^a[i];
         lld kk=accumulate(a,a+n,0);
         if(kk==2*xr){ cout<<0<<nl; cout<<nl; continue;}
         if(kk>2*xr){
         cout<<1<<nl; cout<<(kk-2*xr)<<nl;}
         else{
         cout<<2<<nl; cout<<(2*xr-kk)/2<<" "<<(2*xr-kk)/2<<nl;}
        }
}


/*****Because Its Christmas******/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back
#define mp                make_pair
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end())
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
        lld t; cin>>t;
        while(t--){
            lld n; cin>>n;
            lld sum=0,xr,x;
            cin>>xr;
            sum=xr;
            n--;
            while(n--){
                cin>>x;
                sum+=x;
                xr^=x;
            }
            if(sum==2*xr) cout<<0<<nl<<nl;
            else  cout<<2<<nl<<xr<<" "<<sum+xr<<nl;
        }
}