#include <bits/stdc++.h>
#include <random>

using namespace std;

#define ll long long
#define endl '\n'
#define ld long double
#define pb push_back

const ll clasik = 7e5+7;
const ll INF = 1e17;
const ll mod = 1e9+7;
const ll mln = 1e6+111;

ll df[clasik];

void solve() {

    ll n;

    cin>>n;

    ll sum = 0;

    for (int i =1 ;i<=n ; i++) {
        cin>>df[i];
    
        sum+=df[i];

    }

    if (sum%3==0) {
        ll curr = 0;
        cout<<0<<endl;
        //cout<<1<<" ";
        for (int i = 1 ; i<=n ; i++) {
            if (curr == 0) cout<<i<<" ";
            curr+=df[i];
            curr%=(sum/3);  
        }
        cout<<endl;
        return;
    }

    if (sum%3 == 1) {
        ll curr = 0;
        cout<<1<<endl;
        ll cnt = 0;
        for (int i =1 ; i<=n ; i++) {
            if (curr == 0) {
                cnt++;
                cout<<i<<" ";
            }
            if (cnt == 3) break; 
            curr+=df[i];
            curr%=(sum/3);
        }
        cout<<endl;
        return;
    }

    ll curr = 0;

    cout<<1<<endl;
    ll cnt = 0;

    for (int i = 1 ;i<=n ; i++) {
        if (curr == 0) {
            cnt++;
            cout<<i<<" ";
        }
        if (cnt == 3) break;
        curr+=df[i];
        curr%=(sum/3 + 1);
    }

    cout<<endl;


}

signed main() {
    
    int t = 1;

    cin>>t;

    while(t--) solve();

    return 0;
}