using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); var array = new List[] { new List { 0, 4, 8 }, new List { 1, 5, 9 }, new List { 2, 6, 10 }, new List { 3, 6, 11 } }; for (int i = 0; i < 4; i++) { var count = 0; foreach (var item in input) { if (array[i].Contains(item)) array[i].Remove(item); } if (array[i].Count == 1) { Console.WriteLine(array[i][0]); break; } } } }