#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int M = 100020;
int a[M];
int main()
{
int n,m;
int max,sum;
cin >> n;
for(int j = 1; j <= n; j++)
{
max = -999;
sum = 0;
cin >> m;
memset(a,0,sizeof(a));
int a1 = 0,b1 = 0,tmp = 0;
for(int i = 0; i < m; i++)
cin >> a[i];
for(int i = 0; i < m; i++)
{
sum += a[i];
if(sum > max)
{
a1 = tmp;
max = sum;
b1 = i;
}
if(sum < 0)
{
sum = 0;
tmp = i + 1;
}
}
cout << "Case "<<j<<":"<<endl;
cout << max<<" "<<a1+1 << " "<< b1+1 <<endl;
if( j != n)
cout << endl;
}
return 0;
}