#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define endl '\n'
#define mod 1000000007
ll power(ll x, ll y, ll p)
{
    ll res = 1; 
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
int sum(ll n)
{
    int s=0;
    while(n>0)
    {
        s+=n%10;
        n/=10;
    }
    return s;
}
bool isprime(ll n)
{
    if(n==1)return false;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)return false;
    }
    return true;
}
int test=1;
void solve()
{
  ll n;
  cin>>n;
  ll ar[n+1];
  ll t;
  for(int i=1;i<=n;i++)cin>>ar[i];
  if(n==1)
  {
      cout<<"0"<<endl;
      return;
  }
  for(ll i=1000000000;;i++)
  {
      if(isprime(i))
      {
          t=i;
          break;
      }
  }
  cout<<n/2<<endl;
  for(int i=2;i<=n;i+=2)
  {
      cout<<i-1<<" "<<i<<" "<<min(ar[i-1],ar[i])<<" "<<t<<endl;
  }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int tc;
    cin>>tc;
    while(tc--)
    {
        solve();
    }
    //solve();
    return 0;
}