using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { List list = new List(); string x; while (((x = Console.ReadLine())) != null) { char sign = char.Parse(x); switch (sign) { case '+': { if (list.Count >= 10) Console.WriteLine(":("); else { int number = int.Parse(Console.ReadLine()); list.Add(number); Console.WriteLine(":)"); } break; } case '-': { if (list.Count == 0) Console.WriteLine(":("); else { Console.WriteLine(list[list.Count - 1]); list.Remove(list[list.Count - 1]); } break; } } } } }