Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"sort"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), ",")
		cards := make([]int, 5)
		for i :=range input {
			cards[i], _ = strconv.Atoi(input[i])
		}
		sort.Sort(sort.IntSlice(cards))
		if cards[0] == cards[1] && cards[2] == cards[3] && cards[2] == cards[1] {
			fmt.Println("four card")
		} else if cards[1] == cards[2] && cards[3] == cards[4] && cards[3] == cards[2]{
			fmt.Println("four card")
		} else if cards[0] == cards[1] && cards[1] == cards[2] && cards[3] == cards[4] {
			fmt.Println("full house")
		} else if cards[0] == cards[1] && cards[2] == cards[3] && cards[3] == cards[4] {
			fmt.Println("full house")
		} else if cards[0] == 1 && cards[1] == 10 && cards[2] == 11 && cards[3] == 12 && cards[4] == 13 {
			fmt.Println("straight")
		} else if cards[0]+1 == cards[1] && cards[1]+1 == cards[2] && cards[2]+1 == cards[3] && cards[3]+1 == cards[4] {
			fmt.Println("straight")
		} else if (cards[0] == cards[1] && cards[1] == cards[2]) || (cards[1] == cards[2] && cards[2] == cards[3]) || (cards[2] == cards[3] && cards[3] == cards[4]) {
			fmt.Println("three card")
		} else if ((cards[0] == cards[1]) && ((cards[2] == cards[3]) || (cards[3] == cards[4]))) || ((cards[1] == cards[2]) && (cards[3] == cards[4])) {
			fmt.Println("two pair")
		} else if cards[0] == cards[1] || cards[1] == cards[2] || cards[2] == cards[3] || cards[3] == cards[4] {
			fmt.Println("one pair")
		} else {
			fmt.Println("null")
		}
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int n) { return n & 1; }
constexpr bool even(const int n) { return ~n & 1; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> std::istream &operator>>(std::istream &is, std::pair<A, B> &p) { is >> p.first; is >> p.second; return is; }
using namespace std;
// clang-format on

main {
  vi v(5);
  char gomi;
  while (cin >> v[0] >> gomi >> v[1] >> gomi >> v[2] >> gomi >> v[3] >> gomi >> v[4]) {
    sort(all(v));
    if (v[1] == v[4]) {
      cout << "four card" << endl;
      continue;
    }
    if ((v[0] == v[1] && v[2] == v[4]) || (v[0] == v[2] && v[3] == v[4])) {
      cout << "full house" << endl;
      continue;
    }
    if (v[4] - v[0] == 4 || (v[0] == 1 && v[1] == 10 && v[4] - v[1] == 3)) {
      cout << "straight" << endl;
      continue;
    }
    if (v[0] == v[2] || v[1] == v[3] || v[2] == v[4]) {
      cout << "three card" << endl;
      continue;
    }
    if ((v[0] == v[1] && (v[2] == v[3] || v[3] == v[4])) || (v[1] == v[2] && v[3] == v[4])) {
      cout << "two pair" << endl;
      continue;
    }
    if (v[0] == v[1] || v[1] == v[2] || v[2] == v[3] || v[3] == v[4]) {
      cout << "one pair" << endl;
      continue;
    }
    cout << "null" << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

bool twopair(int a, int b, int c, int d, int e) {
    vector<int> v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    v.push_back(d);
    v.push_back(e);
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    if (v.size() == 3) return true;
    else return false;
}

bool straight(int a, int b, int c, int d, int e) {
    vector<int> v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    v.push_back(d);
    v.push_back(e);
    sort(v.begin(), v.end());
    if (v[4]-v[3] == 1 && v[3]-v[2] == 1 && v[2]-v[1] == 1) {
        if (v[1]-v[0] == 1 || (v[0] == 1 && v[4] == 13)) return true;
        else return false;
    }else return false;
}

bool fullhouse(int a, int b, int c, int d, int e) {
    vector<int> v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    v.push_back(d);
    v.push_back(e);
    sort(v.begin(), v.end());
    if (v[3] == v[4]) return true;
    else return false;
}
    
int getMaxPair(int a, int b, int c, int d, int e) {
    vector<int> v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    v.push_back(d);
    v.push_back(e);
    sort(v.begin(), v.end());
    vector<int> cnt;
    int crt = 0;
    int min = v[0];
    REP(i,4) {
        if (v[i+1] == min) {
            crt++;
        }else {
            cnt.push_back(crt);
            min = v[i+1];
            crt = 0;
        }
    }
    cnt.push_back(crt);
    sort(cnt.begin(), cnt.end());
    return cnt.back() + 1;
}

int main() {
    int a,b,c,d,e;
    char ch;
    while(cin>>a>>ch>>b>>ch>>c>>ch>>d>>ch>>e) {
        switch(getMaxPair(a,b,c,d,e)) {
            case 1:
                if (straight(a,b,c,d,e)) {
                    cout << "straight" << endl;
                }else {
                    cout << "null" << endl;
                }
                break;
            case 2:
                if (twopair(a,b,c,d,e)) {
                    cout << "two pair" << endl;
                }else {
                    cout << "one pair" << endl;
                }
                break;
            case 3:
                if (fullhouse(a,b,c,d,e)) {
                    cout << "full house" << endl;
                }else {
                    cout << "three card" << endl;
                }
                break;
            case 4:
                cout << "four card" << endl;
        }
    }
    
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

int c[6];
const string name[] = {
  "null", "one pair", "two pair", "three card",
  "full house", "straight", "four card"
};

void solve() {
  // count pair
  int cnt = 0;
  rep(i,4) for (int j = i+1; j < 5; ++j) {
    if (c[i] == c[j]) ++cnt;
  }

  // check straight
  bool flag = true;
  for (int i = 1; i <= 4; ++i) if (c[0] != c[i]-i) flag = false;
  if (!flag && c[0] == 1) {
    flag = true;
    for (int i = 1; i <= 4; ++i) if (c[i] != 9+i) flag = false;
  }
  if (flag && cnt < 4) cnt = 5;
  
  // output
  //rep(i,5) printf("%3d", c[i]);
  printf("%s\n", name[cnt].c_str());
}

int main() {
  while (scanf("%d", c) != -1) {
    rep(i,4) scanf(",%d", c+i+1);
    sort(c,c+5);
    solve();
  }
  return 0;
}