#include <iostream>
#include <vector>
using namespace std;
int main()
{
int numRow;
cin >> numRow;
int num = numRow;
vector<vector<int>> A;
while (numRow--)
{
vector<int> B;
int numCol;
cin >> numCol;
int b;
for (int i=0; i<numCol; i++)
{
cin >> b;
B.push_back(b);
}
A.push_back(B);
}
for (int j=0; j<num; j++)
{
int maxSum = 0;
int curSum = 0;
int numStar = 1;
int numEnd = 0;
int numMid = 0;
for (int k=0; k<A[j].size(); k++)
{
curSum += A[j][k];
if (maxSum < curSum)
{
maxSum = curSum;
numStar = numStar;
numEnd = k + 1;
}
if (curSum < 0)
{
numStar = numStar + 1;
curSum = 0;
}
}
cout << "Case " << j+1 << ":" << endl;
cout << maxSum << " " << numStar << " " << numEnd << endl;
}
return 0;
}