using System; using System.Collections; using System.Collections.Generic; using System.Linq; IEnumerable getLine() { return Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)); } void Main() { IEnumerable inputs = getLine(); int wantedNum = inputs.First(); IEnumerable mrMaxList = getLine(); IEnumerable maxValuList = getLine(); bool isMrMax = mrMaxList.Contains(wantedNum); bool isMaxValu = maxValuList.Contains(wantedNum); if (isMrMax && isMaxValu) { Console.WriteLine("MrMaxValu"); } else if (isMrMax) { Console.WriteLine("MrMax"); } else if (isMaxValu) { Console.WriteLine("MaxValu"); } else { Console.WriteLine("-1"); } } Main();