using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("204 507 241 694 2293 -1 -1"); } else if (InputPattern == "Input2") { WillReturn.Add("118 378 -1 -1 -1 -1 -1"); } else if (InputPattern == "Input3") { WillReturn.Add("1000 1000 1000 1000 1000 1000 1000"); } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static long[] GetSplitArr(string pStr) { return (pStr == "" ? new string[0] : pStr.Split(' ')).Select(pX => long.Parse(pX)).ToArray(); } static void Main() { List InputList = GetInputList(); long[] TArr = GetSplitArr(InputList[0]); long Sum = 0; foreach (long EachA in TArr) { if (EachA == -1) { Console.WriteLine(-1); continue; } Sum += EachA; Console.WriteLine(6000 - Sum); } } }