using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { string[] A = Console.ReadLine().Split(' '); string[] B = Console.ReadLine().Split(' '); string a = A[1]; string b = B[1]; if (a == b) { Console.WriteLine(-1); return; } if (Big(a, b)) { Console.WriteLine(A[0]); return; } Console.WriteLine(B[0]); } static bool Big(string a,string b) { if (a.Length > b.Length) { return true; } if (a.Length < b.Length) { return false; } for(int i = 0; i < a.Length; i++) { if (int.Parse(a[i].ToString()) > int.Parse(b[i].ToString())) { return true; } if(int.Parse(a[i].ToString()) < int.Parse(b[i].ToString())) { return false; } } return false; } }