fun main() { val a = readln().split(" ").map { it.toInt() }.sorted() val counts = Array(5) { 0 } var prev = 0 counts[0] = 1 for(i in 1..<5) { if(a[prev] == a[i]) { counts[prev]++ } else { prev = i counts[i] = 1 } } var count3 = 0 var count2 = 0 for(c in counts) { when(c) { 2 -> count2++ 3 -> count3++ } } val msg = when { count3 == 1 && count2 == 1 -> "FULL HOUSE" count3 == 1 -> "THREE CARD" count2 == 2 -> "TWO PAIR" count2 == 1 -> "ONE PAIR" else -> "NO HAND" } println(msg) }