CodeEff/ECCO huggingface dataset:
# Original solution
from collections import deque
n,m,k=list(map(int,input().split()))
flag=[0]*(n+1)
friend=[[] for i in range(n+1)]
block=[[] for i in range(n+1)]
for i in range(m):
    a,b=list(map(int, input().split()))
    friend[a].append(b)
    friend[b].append(a)

for i in range(k):
    a, b = list(map(int, input().split()))
    block[a].append(b)
    block[b].append(a)

d=deque()
m=1
for i in range(1,n+1):
    if flag[i]==0:
        d.append(i)
        flag[i]=m
        while len(d)>0:
            a=d.popleft()
            for j in range(len(friend[a])):
                if flag[friend[a][j]]!=m:
                    flag[friend[a][j]]=m
                    d.append(friend[a][j])
        m+=1
#print(flag)
#print(friend)
#print(block)
answer=[0]*n
for i in range(1,n+1):
    a=sum(x==flag[i] for x in flag)
    b=len(friend[i])+1
    c=0
    for x in range(1,n+1):
        if flag[x]==flag[i] and (x in block[i]):
            c+=1
    #print(a,b,c)
    answer[i-1]=a-b-c

print((" ".join(map(str, answer))))

# Optimized solution
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m,k=list(map(int, input().split()))
friend=[[] for i in range(n+1)]
block_count=[0]*(n+1)
uf=UnionFind(n+1)
for i in range(1,m+1):
    a,b=list(map(int, input().split()))
    friend[a].append(b)
    friend[b].append(a)
    uf.union(a,b)

for i in range(1,k+1):
    a,b=list(map(int, input().split()))
    if uf.same(a,b)==True:
        block_count[a]+=1
        block_count[b] += 1

answer=[0]*(n)
for i in range(1,n+1):
    answer[i-1]=uf.size(i)-len(friend[i])-block_count[i]-1
    #print(uf.size(i))

print((" ".join(map(str,answer))))
#print(friend)
#print(uf)
#print(block_count)
# Original solution
def main():
    N,M,K=list(map(int,input().split()))

    G=[[] for i in range(N)]

    for i in range(M):
        a,b=list(map(int,input().split()))
        G[a-1].append(b-1)
        G[b-1].append(a-1)

    C=[]
    D=[]
    for i in range(K):
        c,d=list(map(int,input().split()))
        C.append(c-1)
        D.append(d-1)
    trace=[-1 for i in range(N)]
    Group=[]

    for i in range(N):
        stack=[]
        if trace[i]==-1:
            trace[i]=0
            stack.append(i)
        Group_tmp=[]
        while len(stack)>0:
            index=stack.pop()
            Group_tmp.append(index)
            for j in G[index]:
                if trace[j]==-1:
                    trace[j]=0
                    stack.append(j)
        if len(Group_tmp)!=0:
            Group.append(Group_tmp)

    res=[0 for i in range(N)]
    GroupMarker=[-1 for i in range(N)]

    for i in range(len(Group)):
        for j in range(len(Group[i])):
            person=Group[i][j]
            GroupMarker[person]=i
            r=len(Group[i])-len(G[person])-1
            res[person]=r
    for i in range(K):
        if D[i] in Group[GroupMarker[C[i]]]:
            res[D[i]]-=1
            res[C[i]]-=1

    res=list(map(str,res))
    print((" ".join(res)))

if __name__=="__main__":
    main()





# Optimized solution
def main():
    N,M,K=list(map(int,input().split()))

    G=[[] for i in range(N)]

    for i in range(M):
        a,b=list(map(int,input().split()))
        G[a-1].append(b-1)
        G[b-1].append(a-1)

    B=[[] for i in range(N)]
    for i in range(K):
        c,d=list(map(int,input().split()))
        B[c-1].append(d-1)
        B[d-1].append(c-1)
    trace=[-1 for i in range(N)]
    Group=[]

    for i in range(N):
        stack=[]
        if trace[i]==-1:
            trace[i]=0
            stack.append(i)
        Group_tmp=[]
        while len(stack)>0:
            index=stack.pop()
            Group_tmp.append(index)
            for j in G[index]:
                if trace[j]==-1:
                    trace[j]=0
                    stack.append(j)
        if len(Group_tmp)!=0:
            Group.append(Group_tmp)
    res=[0 for i in range(N)]
    GroupMarker=[-1 for i in range(N)]

    for i in range(len(Group)):
        for j in range(len(Group[i])):
            person=Group[i][j]
            GroupMarker[person]=i
            r=len(Group[i])-len(G[person])-1
            res[person]=r

    for i in range(len(B)):
        for j in range(len(B[i])):
            if GroupMarker[i]==GroupMarker[B[i][j]]:
                res[i]-=1
    res=list(map(str,res))
    print((" ".join(res)))

if __name__=="__main__":
    main()
# Original solution
import sys
#input=sys.stdin.readline
class UnionFind():
  def __init__(self,n):
    self.n=n
    self.parent=list(range(n))
    self.size=[1]*n
    #print(self.size, end=" self.size \n")
  def find(self,x):
    if self.parent[x]==x:
      return x
    else:
      self.parent[x]=self.find(self.parent[x])
      return self.parent[x]
  def union(self,x,y):
    x=self.find(x)
    y=self.find(y)
    if x==y:
      return
    else:
      if self.size[x]>=self.size[y]:
        self.parent[y]=x
        self.size[x]+=self.size[y]
      else:
        self.parent[x]=y
        self.size[y]+=self.size[x]
  def cnt(self,x):
    return self.size[self.find(x)]
def main():
  n,m,k=list(map(int,input().split()))
  u=UnionFind(n)
  ans=[0]*n
  for _ in range(m):
    a,b=list(map(int,input().split()))
    a-=1
    b-=1
    u.union(a,b)
    ans[a]-=1
    ans[b]-=1
  for _ in range(k):
    c,d=list(map(int,input().split()))
    c-=1
    d-=1
    if u.find(c)==u.find(d):
      ans[c]-=1
      ans[d]-=1
  for i in range(n):
    ans[i]+=u.cnt(i)-1
  print((" ".join(map(str,ans))))
main()


# Optimized solution
import sys
input=sys.stdin.readline
class UnionFind():
  def __init__(self,n):
    self.n=n
    self.parent=list(range(n))
    self.size=[1]*n
    #print(self.size, end=" self.size \n")
  def find(self,x):
    if self.parent[x]==x:
      return x
    else:
      self.parent[x]=self.find(self.parent[x])
      return self.parent[x]
  def union(self,x,y):
    x=self.find(x)
    y=self.find(y)
    if x==y:
      return
    else:
      if self.size[x]>=self.size[y]:
        self.parent[y]=x
        self.size[x]+=self.size[y]
      else:
        self.parent[x]=y
        self.size[y]+=self.size[x]
  def cnt(self,x):
    return self.size[self.find(x)]
def main():
  n,m,k=list(map(int,input().split()))
  u=UnionFind(n)
  ans=[0]*n
  for _ in range(m):
    a,b=list(map(int,input().split()))
    a-=1
    b-=1
    u.union(a,b)
    ans[a]-=1
    ans[b]-=1
  for _ in range(k):
    c,d=list(map(int,input().split()))
    c-=1
    d-=1
    if u.find(c)==u.find(d):
      ans[c]-=1
      ans[d]-=1
  for i in range(n):
    ans[i]+=u.cnt(i)-1
  print((" ".join(map(str,ans))))
main()
# Original solution
from collections import deque

n, m, k = list(map(int, input().split()))
f = [set() for _ in range(n)]
l = [set() for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a, b = a-1, b-1
    f[a].add(b)
    f[b].add(a)
for _ in range(k):
    c, d = list(map(int, input().split()))
    c, d = c-1, d-1
    l[d].add(c)
    l[c].add(d)

q = deque()
ans = [0] * n
for i in range(n):
    e = [0] * n
    z = [0] * n
    e[i] = 1
    for j in f[i]:
        q.appendleft(j)
        e[j] = 1
    for j in l[i]:
        z[j] = 1
    while q:
        v = q.pop()
        for j in f[v]:
            if e[j] == 0:
                q.appendleft(j)
                e[j] = 1
                if z[j] == 0:
                    ans[i] += 1
print((' '.join(list(map(str, ans)))))

# Optimized solution
class UnionFind():
    def __init__(self, n):
        self.parents = [-1] * n
    
    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            return self.root(self.parents[x])
    
    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return
        else:
            if x > y:
                x, y = y, x
            self.parents[x] += self.parents[y]
            self.parents[y] = x
            return

n, m, k = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
cd = [list(map(int, input().split())) for _ in range(k)]

u = UnionFind(n)
f = [set() for _ in range(n)]
l = [set() for _ in range(n)]
for a, b in ab:
    a, b = a-1, b-1
    f[a].add(b)
    f[b].add(a)
    u.unite(a, b)
for c, d in cd:
    c, d = c-1, d-1
    l[c].add(d)
    l[d].add(c)
ans = [0] * n
for i in range(n):
    r = u.root(i)
    bl = 0
    for j in l[i]:
        if u.root(j) == r:
            bl += 1
    ans[i] = -u.parents[r] - len(f[i]) - bl - 1
print((' '.join(list(map(str, ans)))))
# Original solution
from collections import deque
from copy import deepcopy
N, M, K = list(map(int, input().split()))
SNS = [[0 for _ in range(N+1)] for __ in range(N+1)]
Follow = [deque() for __ in range(N+1)]
for _ in range(M):
  a, b = list(map(int, input().split()))
  SNS[a][b] = 1
  SNS[b][a] = 1
  Follow[a].append(b)
  Follow[b].append(a)
for _ in range(K):
  a, b = list(map(int, input().split()))
  SNS[a][b] = -1
  SNS[b][a] = -1

Chains = []
seen = [False]*(N+1)
i = 1
while i <= N:
  if not seen[i]:
    seen[i] = True
    chain = deque()
    q = deque(deepcopy(Follow[i]))
    memo = [False]*(N+1)
    while q:
      j = q.pop()
      if not memo[j]:
        memo[j] = True
        seen[j] = True
        chain.append(j)
        q += deepcopy(Follow[j])
    Chains.append(deepcopy(chain))
  i += 1
ans = [0] * (N+1)

for chain in Chains:
  l = len(chain)
  for hito in chain:
    n = 0
    for aite in chain:
      n += 0 if SNS[hito][aite] == 0 else 1
    ans[hito] = l - n -1
print((" ".join([str(a) for a in ans[1:]])))

# Optimized solution
from collections import deque
from copy import deepcopy

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M, K = list(map(int, input().split()))
UF = UnionFind(N+1)
direct_connect = [0]*(N+1)
for _ in range(M):
  a, b = list(map(int, input().split()))
  UF.union(a, b)
  direct_connect[a] += 1
  direct_connect[b] += 1
for _ in range(K):
  a, b = list(map(int, input().split()))
  if UF.same(a, b):
    direct_connect[a] += 1
    direct_connect[b] += 1
print((" ".join([str(UF.size(i)-direct_connect[i]-1) for i in range(1, N+1)])))
# Original solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n)]for j in range(n)]
    flag0=0
    for i in range(n):
        j=0
        for c in input():
            if c == ".":
                flag0=1
                dp[i][j]=1
            j+=1
    if flag0==0:
        print(0)
    else:
        solve=1
        while True:
            flag=0
            for y in range(n-1):
                for x in range(n-1):
                    if dp[y][x]!=0:
                        old=dp[y][x]
                        dp[y][x]=min(dp[y+1][x],dp[y][x+1],dp[y+1][x+1])+1
                        if old!=dp[y][x]:
                            flag=1
            if flag==0:
                break
            solve+=1
        print(solve)

# Optimized solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n)]for j in range(n)]
    flag0=0
    for i in range(n):
        j=0
        for c in input():
            if c == ".":
                flag0=1
                dp[i][j]=1
            j+=1
    if flag0==0:
        print(0)
    else:
        solve=1
        while True:
            flag=0
            for y in range(n-solve):
                for x in range(n-solve):
                    if dp[y][x]!=0:
                        old=dp[y][x]
                        dp[y][x]=min(dp[y+1][x],dp[y][x+1],dp[y+1][x+1])+1
                        if old!=dp[y][x]:
                            flag=1
            if flag==0:
                break
            solve+=1
        print(solve)
# Original solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n)]for j in range(n)]
    flag0=0
    for i in range(n):
        j=0
        for c in input():
            if c == ".":
                dp[i][j]=1
                flag0=1
            j+=1
    if flag0==0:
        print(0)
    else:
        solve=1
        while True:
            flag=0
            for y in range(n-1):
                for x in range(n-1):
                    if dp[y][x]!=0:
                        old = dp[y][x]
                        dp[y][x]=min(dp[y+1][x],dp[y][x+1],dp[y+1][x+1])+1
                        if dp[y][x]-old==1:
                            flag=1
            if flag==0:
                break
            solve+=1
        print(solve)

# Optimized solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n)]for j in range(n)]
    for i in range(n):
        j=0
        for c in input():
            if c == ".":
                dp[i][j]=1
            j+=1
    for i in range(1,n):
        for j in range(1,n):
            if dp[i][j]==1:
                dp[i][j]=min(dp[i-1][j],dp[i][j-1],dp[i-1][j-1])+1
    allmax=0
    for i in range(n):
        if allmax<max(dp[i]):
            allmax=max(dp[i])
    print(allmax)
# Original solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n)]for j in range(n)]
    for i in range(n):
        j=0
        for c in input():
            if c == ".":
                dp[i][j]=1
            j+=1
    for i in range(1,n):
        for j in range(1,n):
            if dp[i][j]==1:
                dp[i][j]=min(dp[i-1][j],dp[i][j-1],dp[i-1][j-1])+1
    allmax=0
    for i in range(n):
        if allmax<max(dp[i]):
            allmax=max(dp[i])
    print(allmax)

# Optimized solution
while True:
    n=eval(input())
    if n==0:
        break
    dp=[[0 for i in range(n+1)]for j in range(n+1)]
    for i in range(1,n+1):
        j=0
        line=" "+input()
        for c in line:
            if c == ".":
                dp[i][j]=min(dp[i-1][j],dp[i][j-1],dp[i-1][j-1])+1
            j+=1
    allmax=0
    for i in range(n+1):
        if allmax<max(dp[i]):
            allmax=max(dp[i])
    print(allmax)
# Original solution
while 1:
    n = int(input())
    if n == 0:
        break
    dp = [[0] * n for i in range(n)]
    r = 0
    for i in range(n):
        for j, ch in enumerate(input()):
            if ch == '*':
                continue
            dp[i][j] = 1
            if i >= 1 or j >= 1:
                for k in range(1, dp[i - 1][j - 1] + 1):
                    if dp[i - k][j] == 0 or dp[i][j - k] == 0:
                        break
                    dp[i][j] += 1
            r = max(r, dp[i][j])
    print(r)

# Optimized solution
while 1:
    n = int(input())
    if n == 0:
        break
    dp = [[0] * n for i in range(n)]
    r = 0
    for i in range(n):
        for j, ch in enumerate(input()):
            if ch == '*':
                continue
            dp[i][j] = 1
            if i >= 1 or j >= 1:
                dp[i][j] += min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1])
            r = max(r, dp[i][j])
    print(r)
# Original solution
while True:
	n = int(input())
	if n == 0: break
	field = [input() for i in range(n)]
	flag = 0
	for len in range(n,-1,-1):
		for row in range(n-len+1):
			for sp in range(n-len+1):
				if field[row][sp:sp+len] == "."*len:
					for i in range(1,len):
						if field[row+i][sp:sp+len] != "."*len:
							if len == 1:
								print(0)
							break
					else:
						print(len)
						flag = 1
				if flag: break
			if flag: break
		if flag: break

# Optimized solution
while True:
    n = int(input())
    if n == 0: break
    field = [input() for i in range(n)]
    large = [[0] * (n + 1) for i in range(n + 1)]
    mx = 0
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
                if large[i][j] > mx:
                	mx = large[i][j]
    print(mx)
# Original solution
#!/usr/bin/env python

from sys import stdin, exit


def main(readline=stdin.readline):
    while 1:
        n = int(readline())
        if not n:
            exit()

        pre = [0] * (n+1)
        now = [0] * (n+1)
        maximum = 0

        for _ in range(n):
            for x, c in enumerate(readline().rstrip(), 1):
                if c == '.':
                    now[x] = min(pre[x-1], pre[x], now[x-1]) + 1
                    if maximum < now[x]:
                        maximum = now[x]

            for x in range(1, n+1):
                pre[x] = now[x]
                now[x] = 0

        print(maximum)


main()

# Optimized solution
#!/usr/bin/env python

from sys import stdin, exit


def main(readline=stdin.readline):
    while 1:
        n = int(readline())
        if not n:
            exit()

        pre = [0] * (n+1)
        now = [0] * (n+1)
        maximum = 0

        for _ in range(n):
            for x, c in enumerate(readline().rstrip(), 1):
                if c == '.':
                    now[x] = min(pre[x-1], pre[x], now[x-1]) + 1
                    if maximum < now[x]:
                        maximum = now[x]
            pre = now
            now = [0] * (n+1)

        print(maximum)


main()
# Original solution
import sys

while 1:
  n=eval(input())
  if n==0:break
  A=[input() for i in range(n)]
  B=[]
  c=0
  for i in range(n):
    if c==0 and '1' in A[i]: c=1
    B.append(int(A[i].replace('.','1').replace('*','0'),2))
  C=B[:]
  for i in range(1,n):
    for j in range(n-i):
      B[j]&=B[j+1]
      if '1'*(i+1) in format(B[j],'b'): c=i+1
  print(c)

# Optimized solution
import sys

while 1:
  n=eval(input())
  if n==0:break
  A=[input() for i in range(n)]
  B=[]
  c=0
  for i in range(n):
    if c==0 and '1' in A[i]: c=1
    B.append(int(A[i].replace('.','1').replace('*','0'),2))
  C=B[:]
  for i in range(1,n):
    for j in range(n-i):
      B[j]&=B[j+1]
      if '1'*(i+1) in format(B[j],'b'): c=i+1
    if c!=i+1: break
  print(c)
# Original solution
import sys

while 1:
  n=eval(input())
  if n==0:break
  A=[input() for i in range(n)]
  B=[]
  c=0
  for i in range(n):
    if c==0 and '1' in A[i]: c=1
    B.append(int(A[i].replace('.','1').replace('*','0'),2))
  C=B[:]
  for i in range(1,n):
    for j in range(n-i):
      B[j]&=B[j+1]
      if '1'*(i+1) in format(B[j],'b'): c=i+1
    if c!=i+1: break
  print(c)

# Optimized solution
import sys

while 1:
  n=eval(input())
  if n==0:break
  A=[' '*(n+1)]+[' '+input() for i in range(n)]
  M=[[0]*(n+1) for i in range(n+1)]
  c=0
  for i in range(1,n+1):
    for j in range(1,n+1):
      if A[i][j]=='.': M[i][j]=min(M[i-1][j-1],M[i-1][j],M[i][j-1])+1
    c=max(c,max(M[i]))
  print(c)
# Original solution
import sys

while 1:
  n=eval(input())
  if n==0:break
  A=[' '*(n+1)]+[' '+input() for i in range(n)]
  M=[[0]*(n+1) for i in range(n+1)]
  c=0
  for i in range(1,n+1):
    for j in range(1,n+1):
      if A[i][j]=='.': M[i][j]=min(M[i-1][j-1],M[i-1][j],M[i][j-1])+1
    c=max(c,max(M[i]))
  print(c)

# Optimized solution
import sys

while 1:
  n=eval(input())+1
  if n==1:break
  A=[''*n]+[' '+input() for i in range(1,n)]
  M=[[0]*n for i in range(n)]
  for i in range(1,n):
    for j in range(1,n):
      if A[i][j]=='.': M[i][j]=min(M[i-1][j-1],M[i-1][j],M[i][j-1])+1
  print(max(list(map(max,M))))
# Original solution
import sys

while 1:
  n=eval(input())+1
  if n==1:break
  A=[''*n]+[' '+input() for i in range(1,n)]
  M=[[0]*n for i in range(n)]
  for i in range(1,n):
    for j in range(1,n):
      if A[i][j]=='.': M[i][j]=min(M[i-1][j-1],M[i-1][j],M[i][j-1])+1
  print(max(list(map(max,M))))

# Optimized solution
import sys

while 1:
  n=eval(input())+1
  if n==1:break
  N=list(range(n))
  N1=N[1:]
  A=[''*n]+[' '+input() for i in N1]
  M=[[0]*n for i in N]
  y=M[0]
  for i in N1:
    x=[0]*n
    B=A[i]
    for j in N1:
      if B[j]=='.': x[j]=min(y[j-1],y[j],x[j-1])+1
    M[i]=x
    y=x
  print(max(list(map(max,M))))
# Original solution
import sys

while 1:
  n = eval(input()) + 1
  if n==1: break
  N = list(range(n))
  M = [[0] * n for i in N]
  y = M[0]
  for i in N[1:]:
    x = [0] * n
    A = ' ' + input()
    for j in N[1:]:
      if A[j] == '.': x[j] = min(y[j-1],y[j],x[j-1]) + 1
    M[i] = x
    y = x
  print(max(list(map(max,M))))

# Optimized solution
import sys

while 1:
  n = eval(input()) + 1
  if n==1: break
  N = list(range(n))
  M = [0] * n
  y = [0] * n
  for i in N[1:]:
    x = [0] * n
    A = ' ' + input()
    for j in N[1:]:
      if A[j] == '.': x[j] = min(y[j-1],y[j],x[j-1]) + 1
    M[i]=max(x)
    y = x
  print(max(M))
# Original solution
while True:
    try:
        hand = list(map(int, input().split(",")))
        kind = list(set(hand))
        rank =[]
        for card in kind:
            rank.append(hand.count(card))
            rank.sort()
            rank.reverse()
        if rank[0] == 4:
            print("four card")
        elif rank[0] == 3:
            if rank[1] == 2:
                print("full house")
            else:
                print("three card")
        elif rank[0] == 2:
            if rank[1] == 2:
                print("two pair")
            else:
                print("one pair")
        else:
            hand.sort()
            if hand[4] - hand[0] == 4 or (hand[0] == 1 and hand[1] == 10):
                print("straight")
            else:
                print("null")
    except:
        break

# Optimized solution
while True:
      try:
            hand = sorted(map(int, input().split(",")))
            kind = len(set(hand))
            ma = max([hand.count(i) for i in hand])
            if kind == 4:
                  print("one pair")
            elif kind == 3:
                  if ma == 2:
                        print("two pair")
                  else:
                        print("three card")
            elif kind == 2:
                  if ma==4:
                        print("four card")
                  else:
                        print("full house")
            else:
                  if hand==[1,10,11,12,13] or hand[4] - hand[0] == 4:
                        print("straight")
                  else:
                        print("null")
      except:
            break