// https://yukicoder.me/problems/no/227 fun main() { val a = readln().split(" ").map { it.toInt() }.sorted() val counts = mutableListOf(0, 0, 0, 0, 0) var prev = 0 counts[0] = 1 for(i in 1..4) { if (a[prev] == a[i]){ counts[prev] += 1 } else { prev = i counts[i] = 1 } } var twoCount = 0 var threeCount = 0 for(i in 0..4) { if(counts[i] == 2) twoCount += 1 else if(counts[i] == 3) threeCount += 1 } when { threeCount == 1 && twoCount == 1 -> println("FULL HOUSE") threeCount == 1 -> println("THREE CARD") twoCount == 2 -> println("TWO PAIR") twoCount == 1 -> println("ONE PAIR") else -> println("NO HAND") } }