import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto ai = readln.split.map!(to!int).map!("a - 1"); auto p = iota(13).count!(a => ai.count!(b => b == a) == 2); auto t = iota(13).count!(a => ai.count!(b => b == a) == 3); if (p == 1 && t == 1) writeln("FULL HOUSE"); else if (t == 1) writeln("THREE CARD"); else if (p == 2) writeln("TWO PAIR"); else if (p == 1) writeln("ONE PAIR"); else writeln("NO HAND"); }