using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RosalinaCSharp
{
class Program
{
static void Main(string[] args)
{
int totalCount = -1;
int maxDay = 0;
string lastName = "";
StreamReader file = new StreamReader("input.txt");
StreamWriter outFile = new StreamWriter("output.txt");
string line;
while((line = file.ReadLine()) != null)
{
string[] bits = line.Split(' ');
int tmpTotalCount = 0;
int tmpMaxDay = 1;
string tmpLastName = bits[0];
for (int i = 1; i < bits.Length; i++)
{
tmpTotalCount += int.Parse(bits[i]);
if (int.Parse(bits[i]) > int.Parse(bits[tmpMaxDay]))
{
tmpMaxDay = i;
}
}
if (tmpTotalCount > totalCount)
{
totalCount = tmpTotalCount;
lastName = tmpLastName;
maxDay = tmpMaxDay;
}
outFile.WriteLine(lastName + ", всего деталей: " + tmpTotalCount);
}
outFile.WriteLine("Лучший: " + lastName + ", номер дня недели: " + (maxDay + 1));
outFile.Close();
file.Close();
}
}
}