package me.yukicoder; import java.util.Scanner; /** * No.293 4>7の世界 * star 2 * http://yukicoder.me/problems/728 */ public class YukiCoder293 { public static void main(String[] args) { run(); } public static void run() { Scanner sc = new Scanner("1237564890 1234567890"); // Scanner sc = new Scanner(System.in); String s = sc.nextLine(); String[] org = s.split(" "); String l = org[0]; String r = org[1]; s = s.replace('4', 'A'); s = s.replace('7', '4'); s = s.replace('A', '7'); String[] ss = s.split(" "); long a = Long.parseLong(ss[0]); long b = Long.parseLong(ss[1]); boolean left = false; if (a > b) { left = true; } System.out.println(left ? l : r); // System.out.println(Math.max(a, b)); } /* 4 7 4 5 7 5 40 170 170 1237564890 1234567890 1234567890 */ }