def q*a;a.delete a[0];a.empty?end;$<.map{|x|a,b,c,d,e=s=x.chop.split(",").map(&:to_i).sort;f,g,n=q(c,d,e),q(a,b,c),s.uniq.size;puts %w{four\ card full\ house straight three\ card two\ pair one\ pair null}[case;when q(a,b,c,d)||q(b,c,d,e);0;when a==b&&f||g&&d==e;1;when s==(a..e).to_a||s==[1,10,11,12,13];2;when g||q(b,c,d)||f;3;when n==3;4;when n==4;5;else 6;end]}