package Yukicoder /** * Created by hichikawa on 2015/11/02. */ fun main(args: Array) { fun readLineLongArray() : List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toLong() } return ret } fun readLineLong() : Long { val str = readLine() as String return str.toLong() } fun readLineStringArray() : List { val str = readLine() as String val arrStr = str.split(" ") return arrStr } val arrStr = readLineStringArray() val numStr1 = arrStr[0] val numStr2 = arrStr[1] if (numStr1.length != numStr2.length) { if (numStr1.length > numStr2.length) { println(numStr1) return } else { println(numStr2) return } } else { for (i in 0..(numStr1.length-1)) { if (!numStr1[i].equals(numStr2[i])) { val n1 = numStr1[i].toString().toInt() val n2 = numStr2[i].toString().toInt() if (n1 == 7 && n2 == 4) { println(numStr2) } else if (n1 == 4 && n2 == 7) { println(numStr1) } else if (n1 > n2) { println(numStr1) } else { println(numStr2) } return } } println(numStr1) } }