using System; public class Hello { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var a = line[0]; var b = line[1]; Console.WriteLine(getAns(a, b)); } public static string getAns(string a, string b) { if (a.Length > b.Length) return a; else if (a.Length < b.Length) return b; for (int i = 0; i < a.Length; i++) { var a2 = int.Parse(a[i].ToString()); var b2 = int.Parse(b[i].ToString()); if (a2 == 4 && b2 == 7) return a; else if (a2 == 7 && b2 == 4) return b; else if (a2 > b2) return a; else if (a2 < b2) return b; } return ""; } }