Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

N,K = map(int, input().split())
A = sorted(list(map(int,input().split())))

Im = 'IMPOSSIBLE'
Po = 'POSSIBLE'

if A[-1] < K:
    print(Im)
else:
    for i in range(N):
        if i == 0:
            gcd = gcd(A[i], A[i])
        else:
            gcd = gcd(A[i],gcd)
    if K%gcd == 0:
        print('Po')
    else:
        print('Im')


Fixed submission:
def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

N,K = map(int, input().split())
A = sorted(list(map(int,input().split())))

Im = 'IMPOSSIBLE'
Po = 'POSSIBLE'

if max(A) < K:
    print(Im)
else:
    for i in range(N):
        if i == 0:
            tmp = gcd(A[i], 0)
        else:
            tmp = gcd(A[i],tmp)
        if tmp == 1:
            break
    if K%tmp == 0:
        print(Po)
    else:
        print(Im)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int,input().split())
A = list(map(int,input().split()))

num_max = max(A)
npA = np.sort(A)
npA_fi = np.insert(npA,0,0)
npA_en = np.insert(npA,N,0)
diff = npA_en[1:N] - npA_fi[1:N]

diff_min = np.min(diff)
i = 0
if K > num_max:
    print('IMPOSSIBLE')
    exit()
while np.max(npA) >= K:
    if K in npA:
        print('POSSIBLE')
        exit()
    else:
        npA -= diff_min

print('IMPOSSIBLE')


Fixed submission:
def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

N,K = map(int, input().split())
A = sorted(list(map(int,input().split())))

Im = 'IMPOSSIBLE'
Po = 'POSSIBLE'

if max(A) < K:
    print(Im)
else:
    for i in range(N):
        if i == 0:
            tmp = gcd(A[i], 0)
        else:
            tmp = gcd(A[i],tmp)
        if tmp == 1:
            break
    if K%tmp == 0:
        print(Po)
    else:
        print(Im)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [0]
for i in range(N):
    A.append(int(input()))
old = []
bo = 1
ind = 1
while True:
    if A[bo] == 2:
        print(ind)
        exit()
    else:
        ind += 1
        if bo in old:
            print(-1)
            exit()
        old.append(bo)
        bo = A[bo]


Fixed submission:
N = int(input())
A = [0]
for i in range(N):
    A.append(int(input()))
old = []
bo = 1
ind = 1
while ind <= N:
    if A[bo] == 2:
        print(ind)
        exit()
    else:
        ind += 1
        bo = A[bo]
print(-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

ans = 1
pm = 1

i = 0
tmp = []
while i < N:

    if i == 0:
        if A[i] <= A[i+1]:
            pm = 1
        else:
            pm = -1

        i += 1
    else:
        if pm*(A[i] - A[i-1]) >= 0:
            i += 1
            if pm == 0 and A[i] != A[i-1]:
                if A[i-1] < A[i]:
                    pm = 1
                else:
                    pm = -1
        else:
            i += 1
            if N <= i:
                ans += 1
                break

            if A[i-1] == A[i]:
                pm = 0
            elif A[i-1] < A[i]:
                pm = 1
            else:
                pm = -1

            ans += 1


print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))

if N == 1:
    print(1)
    exit()
ans = 1
pm = 1

i = 0
tmp = []
while i < N:

    if i == 0:
        if A[i] <= A[i+1]:
            pm = 1
        else:
            pm = -1

        i += 1
    else:
        if pm*(A[i] - A[i-1]) >= 0:
            i += 1
            if pm == 0 and A[i] != A[i-1]:
                if A[i-1] < A[i]:
                    pm = 1
                else:
                    pm = -1
        else:
            i += 1
            if N <= i:
                ans += 1
                break

            if A[i-1] == A[i]:
                pm = 0
            elif A[i-1] < A[i]:
                pm = 1
            else:
                pm = -1

            ans += 1


print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

ans = 1
pm = 1

i = 0

while i < N:

    if i == 0:
        if A[i] <= A[i+1]:
            pm = 1
        else:
            pm = -1

        i += 1
    else:
        if pm*(A[i] - A[i-1]) >= 0:
            i += 1
        else:
            i += 1
            if N <= i:
                ans += 1
                break
            if A[i-1] <= A[i]:
                pm = 1
            else:
                pm = -1

            ans += 1


print(ans)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))

if N == 1:
    print(1)
    exit()
ans = 1
pm = 1

i = 0
tmp = []
while i < N:

    if i == 0:
        if A[i] <= A[i+1]:
            pm = 1
        else:
            pm = -1

        i += 1
    else:
        if pm*(A[i] - A[i-1]) >= 0:
            i += 1
            if pm == 0 and A[i] != A[i-1]:
                if A[i-1] < A[i]:
                    pm = 1
                else:
                    pm = -1
        else:
            i += 1
            if N <= i:
                ans += 1
                break

            if A[i-1] == A[i]:
                pm = 0
            elif A[i-1] < A[i]:
                pm = 1
            else:
                pm = -1

            ans += 1


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
A,B = [],[]
for i in range(N):
    A.append(input())
for i in range(M):
    B.append(input())

for i in range(N-M+1):
    ind = -1
    while B[0] in A[i][ind+1:]:
        ind = A[i].find(B[0])
        ch = 0
        for j in range(1,M-1):
            if A[i][ind:ind+M+1] == B[j]:
                ch = 0
                continue
            else:
                ch = 1
                break
        if ch == 0:
            print('Yes')
            exit()
print('No')


Fixed submission:
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
cnt = 0
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt = 0
        for k in range(M):
            if B[k] == A[i+k][j:j+M]:
                cnt += 1
        if cnt == M:
            print('Yes')
            exit()
print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
A,B = [],[]
for i in range(N):
    A.append(input())
for i in range(M):
    B.append(input())

for i in range(N):
    if B[0] in A[i]:
        ind = -1
        while B[0] in A[i][ind+1:]:
            ind = A[i].find(B[0])
            ch = 0
            for j in range(1,M-1):
                if A[i][ind:ind+M+1] == B[j]:
                    ch = 0
                    continue
                else:
                    ch = 1
                    break
            if ch == 0:
                print('Yes')
                exit()
print('No')


Fixed submission:
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
cnt = 0
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt = 0
        for k in range(M):
            if B[k] == A[i+k][j:j+M]:
                cnt += 1
        if cnt == M:
            print('Yes')
            exit()
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = [0 for _ in range(N)]
B = [0 for _ in range(N)]

for i in range(N):
    a,b = map(int,input().split())
    A[i],B[i] = a,b

A = np.array(A)
B = np.array(B)

ans = 0
for i in range(N-1,-1,-1):
    a,b = A[i],B[i]

    if a%b != 0:
        ans += b - a%b
        A[:i+1] += b - a%b

print(ans)


Fixed submission:
import numpy as np

N = int(input())
A = [0 for _ in range(N)]
B = [0 for _ in range(N)]

for i in range(N):
    a,b = map(int,input().split())
    A[i],B[i] = a,b

A = np.array(A)
B = np.array(B)

ans = 0
for i in range(N-1,-1,-1):
    a,b = A[i] + ans,B[i]

    if a%b != 0:
        ans += b - a%b

print(ans)
Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())

ans = 0
if x == y:
    ans = 0
elif abs(x) == abs(y):
    ans = 1
elif x > 0 and y > 0:
    if x < y:
        ans = y - x
    else:
        ans = 2 + (x - y)
elif x < 0 and y < 0:
    if abs(x) < abs(y):
        ans = 2 + abs(abs(x) - abs(y))
    else:
        ans = 2 + abs(abs(x) - abs(y))
elif x*y < 0:
    ans = 1 + abs(abs(b) - abs(a))
elif x*y == 0:
    if x == 0:
        if y > 0:
            ans = y
        else:
            ans = abs(y) + 1
    else:
        if x > 0:
            ans = 1 + x
        else:
            ans = abs(x)

print(ans)


Fixed submission:
x,y = map(int, input().split())

ans = 0
if x == y:
    ans = 0
elif abs(x) == abs(y):
    ans = 1
elif x > 0 and y > 0:
    if x < y:
        ans = y - x
    else:
        ans = 2 + (x - y)
elif x < 0 and y < 0:
    if abs(x) < abs(y):
        ans = 2 + abs(abs(x) - abs(y))
    else:
        ans = abs(abs(x) - abs(y))
elif x*y < 0:
    ans = 1 + abs(abs(y) - abs(x))
elif x*y == 0:
    if x == 0:
        if y > 0:
            ans = y
        else:
            ans = abs(y) + 1
    else:
        if x > 0:
            ans = 1 + x
        else:
            ans = abs(x)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = 1
A = 1


for i in range(N):
    t,a = map(int, input().split())

    if max(t,a)%min(t,a) == 0:
        if t > a:
            t = t//a
            a = a
        else:
            t = t
            a = a//t

    j = 0
    while T > t*j or A > a*j:
        j += 1

    T = t*j
    A = a*j

print(T+A)


Fixed submission:
N = int(input())
T = 1
A = 1


for i in range(N):
    t,a = map(int, input().split())

    if max(t,a)%min(t,a) == 0:
        if t > a:
            t = t//a
            a = a
        else:
            t = t
            a = a//t

    j = max(T//t,A//a)
    while T > t*j or A > a*j:
        j += 1

    T = t*j
    A = a*j

print(T+A)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
ans = len(S)
while 'ST' in S:
    num = S.count('ST')
    S = S.replace('ST','',num)


print(len(S))


Fixed submission:
S = input()
ans = len(S)

stack = []
for s in S:

    if s == 'S':
        stack.append(s)
    elif s == 'T' and len(stack) == 0 or stack[-1] == 'T':
        stack.append(s)
    elif s == 'T' and stack[-1] == 'S':
        stack.pop()

print(len(stack))

# #部分点
# while 'ST' in S:
#     num = S.count('ST')
#     S = S.replace('ST','',num)

#print(len(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
ans = len(S)
while 'ST' in S:
    S = S.replace('ST','')


print(len(S))


Fixed submission:
S = input()
ans = len(S)

stack = []
for s in S:

    if s == 'S':
        stack.append(s)
    elif s == 'T' and len(stack) == 0 or stack[-1] == 'T':
        stack.append(s)
    elif s == 'T' and stack[-1] == 'S':
        stack.pop()

print(len(stack))

# #部分点
# while 'ST' in S:
#     num = S.count('ST')
#     S = S.replace('ST','',num)

#print(len(S))
Buggy python submission (verdict: Runtime Error):
S = input()

ans = 0
N = 2**(len(S) - 1)

for i in range(N):
    bit = bin(i)[2:]
    if len(bit) != len(S):
        bit = '0'*(len(S)-len(bit) - 1) + bit

    tmp = S[0]
#    print(bit)
    for i,b in enumerate(bit):
        if b == '0':
            tmp += S[i+1]
        else:
            ans += int(tmp)
            tmp  = S[i+1]
#            tmp += '+' + S[i+1]
    if len(tmp) > 0:
        ans += int(tmp)
print(ans)


Fixed submission:
S = input()

ans = 0
N = 2**(len(S) - 1)

if len(S) == 1:
    print(S)
    exit()
for i in range(N):
    bit = bin(i)[2:]
    if len(bit) != len(S):
        bit = '0'*(len(S)-len(bit) - 1) + bit

    tmp = S[0]
#    print(bit)
    for i,b in enumerate(bit):
        if b == '0':
            tmp += S[i+1]
        else:
            ans += int(tmp)
            tmp  = S[i+1]
#            tmp += '+' + S[i+1]
    if len(tmp) > 0:
        ans += int(tmp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,A = map(int, input().split())
X = map(int,input().split())

ans = 0
X = sorted(X)
for n in range(1,N+1):
    tmp = []
    tmp = list(itertools.combinations(X,n))
    tmp_sum = []

    for i in range(len(tmp)):
        tmp_sum.append(sum(tmp[i]))
    ans += tmp_sum.count(A*n)

print(ans)


Fixed submission:
N,A = map(int, input().split())
X = list(map(int,input().split()))

max_x = max(X)
Y = []
for x in X:
    Y.append(x - A)

dp=[[0 for t in range(60*60*2)] for j in range(60)]
#dp[j番目までの変数から0枚以上選んでy_iの合計を][t-NXにする] = 総数

#dp[0][N*max_x] = 1
for j in range(N+1):
    for t in range(2*N*max_x+1):
        if j == 0 and t == N*max_x:
            dp[j][t] = 1
        else:
            if j>=1 and (t-Y[j-1] < 0 or t - Y[j-1] > 2*N*max_x):
                dp[j][t] = dp[j-1][t]
            elif j>=1 and 0<= t-Y[j-1] <=2*N*max_x:
                dp[j][t] = dp[j-1][t] + dp[j-1][t-Y[j-1]]
            else:
                dp[j][t] = 0
print(dp[N][N*max_x]-1)



# dp=[[[0 for s in range(60*60)] for k in range(60)] for j in range(60)]
# for s in range(60*60):
#     dp[0][0][s]=0
# #dp[j番目までの変数から][k個選んで][合計がs] = になる総数
# for j in range(N+1):
#     for k in range(N+1):
#         for s in range(N*k+1):
#             if j == 0 and k == 0 and s == 0:
#                 dp[j][k][s] = 1
#             else:
#                 if j >= 1 and s < X[j-1]:
#                     dp[j][k][s] = dp[j-1][k][s]
#                 elif j >= 1 and  k >= 1 and s>=X[j-1]:
#                     dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-X[j-1]]
#                 else:
#                     dp[j][k][s] = 0

# print(dp[0][0][6])
# ans = 0
# for k in range(N+1):
#     ans += dp[N][k][k*A]
# print('ans = ',ans)

# import itertools
# N,A = map(int, input().split())
# X = map(int,input().split())

# ans = 0
# X = sorted(X)
# for n in range(1,N+1):
#     tmp = []
#     tmp = list(itertools.combinations(X,n))
#     tmp_sum = []

#     for i in range(len(tmp)):
#         tmp_sum.append(sum(tmp[i]))
#     ans += tmp_sum.count(A*n)
#     if tmp_sum[0] > A*n:
#         break

# print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
  b = input()
  if b = 'A':
    print ('T')
  elif b = 'T':
	print ('A')
  elif b = 'G':
	print ('C')
  else:
    print ('G')

Fixed submission:
if __name__ == '__main__':
  b = input()
  if b == 'A':
    print('T')
  elif b == 'T':
    print('A')
  elif b == 'G':
    print('C')
  elif b == 'C':
    print('G')
Buggy python submission (verdict: Runtime Error):
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
print(max(map(len, s_list)))

Fixed submission:
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
s_list.append(string)
print(max(map(len, s_list)))

Buggy python submission (verdict: Runtime Error):
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

Fixed submission:
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
s_list.append(string)
print(max(map(len, s_list)))

Buggy python submission (verdict: Runtime Error):
S = str(input())
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

Fixed submission:
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
s_list.append(string)
print(max(map(len, s_list)))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_list = [list(map(int, input().split())) for i in N]

x_set = set(A_list[0][1:])
for i in range(1, N):
  x_set = x_set | set(A_list[i][1:])
print(len(x_set))
  

Fixed submission:
N, M = map(int, input().split())
A_list = [list(map(int, input().split())) for i in range(N)]

x_set = set(A_list[0][1:])
for i in range(1, N):
  x_set = x_set & set(A_list[i][1:])
print(len(x_set))
Buggy python submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]

L_list.sort()
print(sum(L_list[::2]))

Fixed submission:
#-*- coding: utf-8 -*-
N = int(input())
L_list = list(map(int, input().split()))
L_list.sort()
print(sum(L_list[::2]))

Buggy python submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]

L_list.sort()
print(sum(L_list[1::2]))

Fixed submission:
#-*- coding: utf-8 -*-
N = int(input())
L_list = list(map(int, input().split()))
L_list.sort()
print(sum(L_list[::2]))
Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'A':
    print 'T'
elif s=='T':
    print 'A'
elif s=='G':
    print 'C'
elif s=='C':
    print 'G'

Fixed submission:
s = str(input())
if s == 'A':
    print('T')
elif s=='T':
    print('A')
elif s=='G':
    print('C')
elif s=='C':
    print('G')
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
input_b = map(int,input().split())
a_list=[input() for i in range(n)]
aa_list=map(int,a_list.split())
for i in range(n):
  answer = c
  count = 0
  lista_item = aa_list[i]
  for j in range(m):
    answer += input_b[m] * lista_item[m]
  if answer > 0
    count+=1
print count

Fixed submission:
w,h = map(int,input().split())
W,H = map(int,input().split())
print(str((W-w)*(H-h)))

Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
input_b = map(int,input().split())
while True:
  try:
    list_a=list(map(int,input().split()))
    answer = c
    count = 0
    for i in range(len(list_a)):
    answer += input_b[i] * list_a[i]
    if answer > 0
      count+=1
    print count
  except:
    break;

Fixed submission:
w,h = map(int,input().split())
W,H = map(int,input().split())
print(str((W-w)*(H-h)))
Buggy python submission (verdict: Runtime Error):
S = input()

subStringList = []
length = len(S)

for i in range(length) :
    for j in range(1,length+1):
        if (i+j <= length) :
            subStringList.append(S[i:i+j])
        else:
            break


for s in subStringList[:]:
    for letter in s:
        if (not(letter in "ATGC")):
            subStringList.remove(s)
            break

print(len(max(subStringList, key=len)))


Fixed submission:
S = input()

subStringList = [S]
length = len(S)

counter = 0
before = 1

while (not(counter == before)):
    before = counter
    for s in subStringList[:]:
        for letter in s:
            if (not(letter in "ATGC")):
                subStringList += s.split(letter)
                subStringList.remove(s)
                counter = len(subStringList)
                break

print(len(max(subStringList,key=len)))

Buggy python submission (verdict: Runtime Error):
S = input()

subStringList = []
length = len(S)

for i in range(length) :
    for j in range(1,length+1):
        if (i+j <= length) :
            subStringList.append(S[i:i+j])
        else:
            break


for s in subStringList[:]:
    for letter in s:
        if (not(letter in "ATGC")):
            subStringList.remove(s)
            break

print(len(max(subStringList)))


Fixed submission:
S = input()

subStringList = [S]
length = len(S)

counter = 0
before = 1

while (not(counter == before)):
    before = counter
    for s in subStringList[:]:
        for letter in s:
            if (not(letter in "ATGC")):
                subStringList += s.split(letter)
                subStringList.remove(s)
                counter = len(subStringList)
                break

print(len(max(subStringList,key=len)))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
K = int(input())
length = len(s)

substringList = []
for i in range(1,length+1) :
    for j in range(length-i+1) :
        substringList.append(s[j:j+i])


substringList = sorted(list(set(substringList)))
print(substringList[K-1])


Fixed submission:
s = input()
K = int(input())
length = len(s)

substringList = []
for i in range(1,K+1) :
    for j in range(length-i+1) :
        substringList.append(s[j:j+i])


substringList = sorted(list(set(substringList)))
print(substringList[K-1])

Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())
length = len(s)
if (length>=5):
    substringList = list(set([s[i] for i in range(length)]))
else :
    substringList = []
    for i in range(1,length+1) :
        for j in range(length-i+1) :
            substringList.append(s[j:j+i])

substringList = sorted(substringList)
print(substringList[K])


Fixed submission:
s = input()
K = int(input())
length = len(s)

substringList = []
for i in range(1,K+1) :
    for j in range(length-i+1) :
        substringList.append(s[j:j+i])


substringList = sorted(list(set(substringList)))
print(substringList[K-1])
Buggy python submission (verdict: Runtime Error):
import itertools as it
# -*- coding: utf-8 -*-
# 個数の入力
N = int(input())
# 改行区切りの名前の入力
S = []
for i in range(N):
    S.append(input())
# データの加工
for i in range(N):
	S[i] = S[i][0]

# 文字列カウント
count = [S.count('M'), S.count('A'), S.count('R'), S.count('C'), S.count('H')]

# 数え上げ
answer = count[0]*count[1]*count[2]
answer = count[0]*count[1]*count[3] + answer
answer = count[0]*count[1]*count[4] + answer
answer = count[0]*count[2]*count[3] + answer
answer = count[0]*count[2]*count[4] + answer
answer = count[0]*count[3]*count[4] + answer
answer = count[1]*count[2]*count[3] + answer
answer = count[1]*count[2]*count[4] + answer
answer = count[1]*count[3]*count[4] + answer
answer = count[2]*count[3]*count[4] + answer

# 出力
print(answer)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# グループ数の計算
g = N // 3
# 出力
print("{}".format(g))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = raw_input().split()
# 出力
if "Y" in S:
	print('Four')
else:
	print('Three')

Fixed submission:
# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = input().split()
# 出力
if "Y" in S:
	print('Four')
else:
	print('Three')

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = raw_input().split()
# 出力
if 'Y' in S:
	print('Four')
else:
	print('Three')

Fixed submission:
# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = input().split()
# 出力
if "Y" in S:
	print('Four')
else:
	print('Three')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    a, b, x = map(int, input().split())
    li = filter(lambda y: y % x == 0, range(a, b + 1))
    print(len(list(li)))


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    a, b, x = map(int, input().split())
    print(b // x + 1 - ((a - 1) // x + 1 if a != 0 else 0))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, K = map(int, input().split())
    res = 0
    if N == 1:
        res = K
    else:
        res = K * (K - 1) * (N - 1)

    print(res)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    a, b, c = map(int, input().split())

    ans = 0
    if a == b and b == c:
        ans = 1
    elif a == b or b == c or c == a:
        ans = 2
    else:
        ans = 3

    print(ans)


if __name__ == "__main__":
    main()