using System; using System.Collections.Generic; using System.Linq; class Program { public void Solve() { string[] ASPX = Console.ReadLine().Split(' '); string[] BSPX = Console.ReadLine().Split(' '); string ap = ASPX[1]; string bp = BSPX[1]; if (ap == bp) { Console.WriteLine(-1); } if (ap.Length != bp.Length) { if (ap.Length > bp.Length) { Console.WriteLine(ASPX[0]); return; } else { Console.WriteLine(BSPX[0]); return; } } for (int i = 0; i < ap.Length; i++) { if (int.Parse(ap.Substring(i, 1)) == int.Parse(bp.Substring(i, 1))) { continue; } if (int.Parse(ap.Substring(i, 1)) > int.Parse(bp.Substring(i, 1))) { Console.WriteLine(ASPX[0]); break; } else { Console.WriteLine(BSPX[0]); break; } } } static void Main() { var solver = new Program(); solver.Solve(); } }