package Yukicoder /** * Created by hichikawa on 2015/11/12. */ 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 readLineInt(): Int { val str = readLine() as String return str.toInt() } fun readLineIntArray() : List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toInt() } return ret } fun readLineDoubleArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toDouble() } return ret } val cards = readLineIntArray().sorted() if (cards[0] == cards[2]) { if (cards[3] == cards[4]) { println("FULL HOUSE") } else { println("THREE CARD") } } else if (cards[2] == cards[4]) { if (cards[0] == cards[1]) { println("FULL HOUSE") } else { println("THREE CARD") } } else if (cards[1] == cards[3]) { println("THREE CARD") } else if (cards[0] == cards[1]) { if (cards[2] == cards[3] || cards[3] == cards[4]) { println("TWO PAIR") } else { println("ONE PAIR") } } else if (cards[1] == cards[2]) { if (cards[3] == cards[4]) { println("TWO PAIR") } else { println("ONE PAIR") } } else if (cards[2] == cards[3] || cards[3] == cards[4]) { println("ONE PAIR") } else { println("NO HAND") } }