defmodule Main do def main do a = li() IO.puts hand(a) end def hand(a) do xs = Enum.frequencies(a) |> Map.values |> Enum.sort case xs do [2, 3] -> "FULL HOUSE" [1, 1, 3] -> "THREE CARD" [1, 2, 2] -> "TWO PAIR" [1, 1, 1, 2] -> "ONE PAIR" _ -> "NO HAND" end end def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) end