using System;
using System.Collections.Generic;
namespace ConsoleApplication1
{
    class Program
    {
        [Flags]
        enum Poker
        {
            OnePair = 1 << 0,
            TwoPair = 1 << 1,
            ThreeCard = 1 << 2,
            Straight = 1 << 3,
            FullHouse = 1 << 4,
            FourCard = 1 << 5,
        }
        static bool IsStraight(int[] arr)
        {
            Array.Sort(arr);
            bool flag = true;
            for (int i = 1; i < arr.Length; i++)
                if (arr[i] != arr[i - 1] + 1)
                    flag = false;
            return flag;
        }
        static void Main(string[] args)
        {
            string str;
            int[] card;
            while (true)
            {
                str = Console.ReadLine();
                if (str == null)
                    Environment.Exit(0);

                string[] buf = str.Split(',');
                card = new int[buf.Length];
                for (int i = 0; i < buf.Length; i++)
                {
                    if (buf[i] == "J")
                        card[i] = 11;
                    else if (buf[i] == "Q")
                        card[i] = 12;
                    else if (buf[i] == "K")
                        card[i] = 13;
                    else if (buf[i] == "A")
                        card[i] = 1;
                    else
                        card[i] = int.Parse(buf[i]);
                }
                Array.Sort(card);
                var dic = new Dictionary<int, int>();
                foreach (int i in card)
                {
                    if (!dic.ContainsKey(i))
                        dic[i] = 1;
                    else
                        dic[i]++;
                }
                int pairNum = 0, flag = 0;
                foreach (int i in dic.Values)
                {
                    if (i == 2)
                    {
                        flag |= (int)Poker.OnePair;
                        pairNum++;
                    }
                    if (i == 3)
                        flag |= (int)Poker.ThreeCard;
                    if (i == 4)
                        flag |= (int)Poker.FourCard;
                }
                if (pairNum == 2)
                    flag |= (int)Poker.TwoPair;
                if ((~flag & ((int)Poker.ThreeCard | (int)Poker.OnePair)) == 0)
                    flag |= (int)Poker.FullHouse;
                if (IsStraight(card))
                    flag |= (int)Poker.Straight;
                card[0] = 14;
                if (IsStraight(card))
                    flag |= (int)Poker.Straight;

                if ((flag & (int)Poker.FourCard) != 0)
                    Console.WriteLine("four card");
                else if ((flag & (int)Poker.FullHouse) != 0)
                    Console.WriteLine("full house");
                else if ((flag & (int)Poker.Straight) != 0)
                    Console.WriteLine("straight");
                else if ((flag & (int)Poker.ThreeCard) != 0)
                    Console.WriteLine("three card");
                else if ((flag & (int)Poker.TwoPair) != 0)
                    Console.WriteLine("two pair");
                else if ((flag & (int)Poker.OnePair) != 0)
                    Console.WriteLine("one pair");
                else
                    Console.WriteLine("null");
            }
        }
    }
}

Measured memory_bytes: 5936