Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
result = 0
n = int(input())
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            result +=  np.gcd.reduce((i,j,k))
print(result)


Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
	for j in range(1, k+1):
		for l  in range(1, k+1):
			ans += gcd(gcd(i, j), l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
result = 0
n = int(input())
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            result +=  np.gcd.reduce((i,j,k))
print(result)


Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
	for j in range(1, k+1):
		for l  in range(1, k+1):
			ans += gcd(gcd(i, j), l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
import numpy as np
n = int(input())
result = 0
list2 = list(range(1,n+1))
all = list(itertools.combinations_with_replacement(list2, 3))
for i in all:
    if(i[0]==i[1] and i[0]==i[2]):
        result += np.gcd.reduce(i)
    elif (i[0]==i[1] or i[0]==i[2] or i[1]==i[2]):
        result += np.gcd.reduce(i)*3
    else:
        result += np.gcd.reduce(i)*6
#print(all)
print(result)


Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
	for j in range(1, k+1):
		for l  in range(1, k+1):
			ans += gcd(gcd(i, j), l)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
import itertools
import numpy as np
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
list2 = []
result = 0
n = int(input())
for i in range(1,n+1):
    if(not(is_prime(i))):
        for j in range(1,n+1):
          for k in range(1,n+1):
#            list2.append([i,j,k])
#            result +=  np.gcd.reduce((i,j,k))
#            print(result ,i,k,j)
    else:
        result += n*n-1
for i in range(1,n+1):
    if(is_prime(i)):
        result += i
print(result)
#print(list2)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
	for j in range(1, k+1):
		for l  in range(1, k+1):
			ans += gcd(gcd(i, j), l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
import numpy as np
list2 = []
result = 0
n = int(input())
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
#            list2.append([i,j,k])
            result +=  np.gcd.reduce((i,j,k))
print(result)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
	for j in range(1, k+1):
		for l  in range(1, k+1):
			ans += gcd(gcd(i, j), l)
print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from typing import *

# def solve(X: int, Y: int, Z: int) -> Any:
def solve(x, y, z):
    x, y = y, x
    x, z = z, x
    return x, y, z

# generated by online-judge-template-generator (https://github.com/kmyk/online-judge-template-generator)
def main():
    X, Y, Z = map(int, input().split())
    ans = solve(X, Y, Z)
    print(*ans)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
# from typing import *

# def solve(X: int, Y: int, Z: int) -> Any:
def solve(x, y, z):
    x, y = y, x
    x, z = z, x
    return x, y, z

# generated by online-judge-template-generator (https://github.com/kmyk/online-judge-template-generator)
def main():
    X, Y, Z = map(int, input().split())
    ans = solve(X, Y, Z)
    print(*ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print(7-'SUN,MON,TUE,WED,THU,FRI,SAT'.split().index(input()))

Fixed submission:
print(7-'SUN,MON,TUE,WED,THU,FRI,SAT'.split(',').index(input()))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import functools
import operator

def solve(m, k):
    if k >= 2 ** m:
        return [-1]
    if m == 1 and k == 0:
        return [0, 1, 1, 0]
    b = list(range(2 ** m))
    b.remove(k)
    if functools.reduce(operator.xor, b) != k:
        return [-1]
    a = b + [k] + list(reversed(b)) + [k]
    return a

print(*solve(*map(int, input().split())))


Fixed submission:
#!/usr/bin/env python3
import functools
import operator

def solve(m, k):
    if k >= 2 ** m:
        return [-1]
    if m == 1 and k == 0:
        return [0, 1, 1, 0]
    b = list(range(2 ** m))
    b.remove(k)
    if functools.reduce(operator.xor, b, 0) != k:
        return [-1]
    a = b + [k] + list(reversed(b)) + [k]
    return a

print(*solve(*map(int, input().split())))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
math_inf = float('inf')  # the Python of AtCoder is too old

def solve(n, m, a):
    cost = [ math_inf, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]

    small = [ None ] * min(100, n)
    small[0] = 0
    for i in range(1, len(small)):
        small[i] = max([ small[i - cost[a_i]] * 10 + a_i for a_i in a if cost[a_i] <= i ] + [ - math_inf ])

    min_cost, min_cost_a_i = min([ (cost[a_i], a_i) for a_i in a ])
    s = ''
    while n:
        k = (n - min_cost) // min_cost
        c = min_cost_a_i
        k, c = max([ ((n - cost[a_i]) // min_cost, a_i) for a_i in a if n - cost[a_i] >= 100 or small[n - cost[a_i]] >= 0 ])
        n -= cost[c]
        s += str(c)
    return s


n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))


Fixed submission:
#!/usr/bin/env python3
math_inf = float('inf')  # the Python of AtCoder is too old

def solve(n, m, a):
    cost = [ math_inf, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]
    dp = [ None ] * (n + 1)
    dp[0] = 0
    for i in range(1, len(dp)):
        dp[i] = max([ dp[i - cost[a_i]] * 10 + a_i for a_i in a if cost[a_i] <= i ] + [ - math_inf ])
    return str(dp[n])


n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math

def solve(n, m, a):
    cost = [ math.inf, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]

    small = [ None ] * min(100, n)
    small[0] = 0
    for i in range(1, len(small)):
        small[i] = max([ small[i - cost[a_i]] * 10 + a_i for a_i in a if cost[a_i] <= i ] + [ - math.inf ])

    min_cost, min_cost_a_i = min([ (cost[a_i], a_i) for a_i in a ])
    s = ''
    while n:
        k = (n - min_cost) // min_cost
        c = min_cost_a_i
        k, c = max([ ((n - cost[a_i]) // min_cost, a_i) for a_i in a if n - cost[a_i] >= 100 or small[n - cost[a_i]] >= 0 ])
        n -= cost[c]
        s += str(c)
    return s


n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))


Fixed submission:
#!/usr/bin/env python3
math_inf = float('inf')  # the Python of AtCoder is too old

def solve(n, m, a):
    cost = [ math_inf, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]
    dp = [ None ] * (n + 1)
    dp[0] = 0
    for i in range(1, len(dp)):
        dp[i] = max([ dp[i - cost[a_i]] * 10 + a_i for a_i in a if cost[a_i] <= i ] + [ - math_inf ])
    return str(dp[n])


n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
n = int(input())
a = input().split()
l = []
r = []
for a_i in a:
    r += [ a_i ]
    l, r = r, l
print(*reversed(l), *r)


Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = input().split()
l = []
r = []
for a_i in a:
    r += [ a_i ]
    l, r = r, l
print(*(list(reversed(l)) + r))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


def main():
    k = int(input())+1
    s = 0
    for a in range(1, k):
        for b in range(1, k):
            for c in range(1, k):
                s += gcd(a, b, c)
    print(s)


main()


Fixed submission:
import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


def main():
    k = int(input())+1
    s = 0
    for a in range(1, k):
        for b in range(1, k):
            for c in range(1, k):
                s += gcd(a, b, c)
    print(s)


main()
Buggy python submission (verdict: Runtime Error):
import numpy as np
r=int(input())
print('{:.2f}'.format(2*np.pi*r))


Fixed submission:
from math import pi

r=int(input())
print(2*pi*r)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
def main():
    n = int(input())
    q = deque(map(int, sys.stdin.readline().split()))
    cnt=1
    while q:
        print(q.count(cnt))
        cnt +=1
        q.popleft()
    print(0)

if __name__ == '__main__':
    main()

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys

def main():
    n = int(input())
    a = tuple(map(int,sys.stdin.readline().split()))
    for cnt in range(len(a)):
        num = 0
        for j in a[cnt:]:
            if j == cnt + 1:
                num += 1
        print(num)
    print(0)

if __name__ == '__main__':
    main()

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=tuple(map(int,input().split()))
for cnt in range(len(a)):
    num=0
    for j in a[cnt:]:
        if j == cnt + 1:
            num += 1
    print(num)
print(0)


Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=tuple(map(int,input().split()))
for cnt, val in enumerate(a):
    num=0
    for j in a[cnt:]:
        if j == cnt + 1:
            num += 1
    print(num)
print(0)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=tuple(map(int,input().split()))
for cnt,val in enumerate(a):
    print(len([j for j in a[cnt:] if j==cnt+1]))
print(0)


Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])
Buggy python submission (verdict: Runtime Error):
A,B,H,M=(int(x) for x in input().split())

import math

time = H*60 + M
dist = (5.5 * time)%360
if 0 < dist < 180:
   dist = 360 - dist

ans = math.sqrt(A*A + B*B  - 2*A*B*math.cos(math.radians(dist)))

print(ans)

Fixed submission:
N = int(input())
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")

Buggy python submission (verdict: Runtime Error):
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")

Fixed submission:
N = int(input())
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")

Buggy python submission (verdict: Runtime Error):
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")

Fixed submission:
N = int(input())
a = int(N/10)
c = N-a*10

if c == 0 or c==1 or c==6 or c==8:
   print("pon")
elif c==3:
   print("bon")
else:
   print("hon")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
H = int(input())
M = int(input())

import math

time = H*60 + M
dist = (5.5 * time)%360
if 0 < dist < 180:
   dist = 360 - dist

ans = math.sqrt(A*A + B*B  - 2*A*B*math.cos(math.radians(dist)))

print(ans)

Fixed submission:
A,B,H,M=(int(x) for x in input().split())

import math

time = H*60 + M
dist = (5.5 * time)%360
if 0 < dist < 180:
   dist = 360 - dist

ans = math.sqrt(A*A + B*B  - 2*A*B*math.cos(math.radians(dist)))

print(ans)
Buggy python submission (verdict: Runtime Error):
ichinikurai = int(input()).[-1]
if ichinikurai in [2,4,5,7,9]:
    print("hon")
else if ichinikurai in [0,1,6,8]:
    print("pon")
else:
    print("bon")

Fixed submission:
ichinikurai = int(input()[-1])
if ichinikurai in [2,4,5,7,9]:
    print("hon")
elif ichinikurai in [0,1,6,8]:
    print("pon")
else:
    print("bon")

Buggy python submission (verdict: Runtime Error):
def therefore(i):
  ichinokurai = i[-1]
  if ichinokurai in [2,4,5,7,9]:
    return "hon"
  else if ichinokurai in [0,1,6,8]:
    return "pon"
  else:
    return "bon"

Fixed submission:
ichinikurai = int(input()[-1])
if ichinikurai in [2,4,5,7,9]:
    print("hon")
elif ichinikurai in [0,1,6,8]:
    print("pon")
else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    S = (S[0:K]+"..."
    print(S)

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = map(str, input().split())
K = int(K)

print(len(S))
print(K)

print(len(S) >= K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = input().split()
K = int(K)

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + '...')

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = input().split()
K = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + '...')

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
K, S = input().split()
K = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")


Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Buggy python submission (verdict: Runtime Error):
k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[1:k] + "...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

if A>K:
    print(K)
elif (A+B)>=K:
    print(A)
else:
    print(A-(K-A-B))


Fixed submission:
S = input()
T = input()

if S == T[:len(T)-1]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

if A>K:
    print(K)
elif (A+B)>=K:
    print(A)
else:
    print(A-(K-A-B))


Fixed submission:
S = input()
T = input()

if S == T[:len(T)-1]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(float, input().split())

if A>K:
    print(K)
elif (A+B)>=K:
    print(A)
else:
    print(A-(K-A-B))


Fixed submission:
S = input()
T = input()

if S == T[:len(T)-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
pt, px, py = 0, 0, 0

for i in range (N):
    t, x, y = map(int, input().split())
    dt = t - pt
    dxy = x-px+y-py
    if dxy > dt or (dxy - dt)%2:
        print("No")
        exit()
    pt, px, py = t, x, y
print("Yes")

Fixed submission:
a, b = map(int, input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
N = int(input())
pt, px, py = 0, 0, 0

for i in range (N):
    t, x, y = map(int, input().split())
    dt = t - pt
    dxy = x-px+y-py
    if dxy > dt or dxy%2 != dt%2:
        print("No")
        exit()
    pt, px, py = x, y, z
print("Yes")

Fixed submission:
n = int(input())
a,b,c=0,0,0
for i in range(n):
    t,x,y = map(int, input().split())
    sa = t-a
    if sa<abs(x-b)+abs(y-c):
        print("No")
        exit()
    else:
        tw = sa-abs(x-b)-abs(y-c)
        if tw%2!=0:
            print("No")
            exit()
    a,b,c=t,x,y
print("Yes")
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")

Fixed submission:
n = int(input())
ones = n % 10
if ones in [2,4,5,7,9]:
  print('hon')
elif ones in [0,1,6,8]:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = int(input())
if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")

Fixed submission:
K = int(input())
S = input()
if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
submap = {}
for each in a:
  try:
    submap[i] += 1
  except:
    submap[i] = 1
for i in range(1, n+1):
  try:
    print(submap[i])
  except:
    print(0)

Fixed submission:

n = int(input())
a = list(map(int, input().split()))
submap = {}
for each in a:
  try:
    submap[each] += 1
  except:
    submap[each] = 1
for i in range(1, n+1):
  try:
    print(submap[i])
  except:
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys
ab = sys.stdin.readline().split(' ')
print(max(ab[0]*int(ab[1]), ab[1]*int(ab[0]))

Fixed submission:
ab = input().split(' ')
print(min(ab[0]*int(ab[1]), ab[1]*int(ab[0])))

Buggy python submission (verdict: Runtime Error):
ab = input().split(' ')
print(max(ab[0]*int(ab[1]), ab[1]*int(ab[0]))

Fixed submission:
ab = input().split(' ')
print(min(ab[0]*int(ab[1]), ab[1]*int(ab[0])))
Buggy python submission (verdict: Runtime Error):
line1 = input().split(' ')
N = line1[0]
D = input().split(' ')
# print(D)
i = -1
while i > -len(N)-1:
    # print("here")
    while (N[i] in D):
        j = abs(i)
        k = (10**(j-1))
        N = str(int(N)+k)
        # print(N)
    i -= 1
print(N)



Fixed submission:
phrases = list(map(int, input().split(' ')))
if phrases.count(5) == 2 and phrases.count(7) == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
if (H*W)%2== 0:
	print(long(H*W/2))
else:
	print(long((H*W)//2+1))

Fixed submission:
H,W = map(int,input().split())
if H == 1 or W == 1:
	print(1)
elif (H*W)%2 == 0:
	print(int(H*W/2))
else:
	print(int((H*W)//2+1))
Buggy python submission (verdict: Runtime Error):
for i in range(3):
	L[i] = list(map(int,input().split()))
import numpy as np
L=[]
bingo = np.zeros([3,3])
for i in range(3):
	L.append(input().split())
L = list(np.reshape(L,9))
N = int(input())
for i in range(N):
	l = input()
	if l in L:
		ptr = L.index(l)
		bingo[ptr/3,ptr%3]=1
#print(bingo)
ans = "No"
flg = 0
for i in range(3):
	flg = flg or bingo[i,0] and bingo[i,1] and bingo[i,2]
for i in range(3):
	flg = flg or bingo[0,i] and bingo[1,i] and bingo[2,i]
flg = flg or bingo[0,0] and bingo[1,1] and bingo[2,2]
flg = flg or bingo[2,0] and bingo[1,1] and bingo[0,2]
if flg == 1:
	ans = "Yes"
print(ans)

Fixed submission:
import numpy as np
L=[]
bingo = np.zeros([3,3])
for i in range(3):
	L.append(input().split())
L = list(np.reshape(L,9))
N = int(input())
for i in range(N):
	l = input()
	if l in L:
		ptr = L.index(l)
		bingo[ptr/3,ptr%3]=1
#print(bingo)
ans = "No"
flg = 0
for i in range(3):
	flg = flg or bingo[i,0] and bingo[i,1] and bingo[i,2]
for i in range(3):
	flg = flg or bingo[0,i] and bingo[1,i] and bingo[2,i]
flg = flg or bingo[0,0] and bingo[1,1] and bingo[2,2]
flg = flg or bingo[2,0] and bingo[1,1] and bingo[0,2]
if flg == 1:
	ans = "Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
if A = "1"or B="1":
	if A = "2"or B="2":
		print("3")
	elif A = "3"or B="3":
		print("2")
elif A = "2"or B="2":
	if A = "3"or B="3":
		print("1")


Fixed submission:
A = input()
B = input()
if A == "1"or B=="1":
	if A == "2"or B=="2":
		print("3")
	elif A == "3"or B=="3":
		print("2")
elif A == "2"or B=="2":
	if A == "3"or B=="3":
		print("1")
Buggy python submission (verdict: Runtime Error):
en = list(map(int,input().split()))
sum = 0
for i in range(2):
	if en[i] == 1:
		sum += 30000
	elif en[i] == 2:
		sum += 20000;
	elif en[i] == 3:
		sum +=10000;
if en[0] ==1 and en[1] == 1:
	sum += 40000
print(sum)

Fixed submission:
en = list(map(int,input().split()))
sum = 0
for i in range(2):
	if en[i] == 1:
		sum += 300000;
	elif en[i] == 2:
		sum += 200000;
	elif en[i] == 3:
		sum +=100000;
if en[0] ==1 and en[1] == 1:
	sum += 400000
print(sum)
Buggy python submission (verdict: Runtime Error):
r = int(input())

return int(r*r)

Fixed submission:
r = int(input())

print(r*r)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 1:
	flg = 1
	print("No")
else:
	for i in range(int(l/2)):
		//print(S[i],S[i+int(l/2)])
		if S[i] != S[i+int(l/2)]:	
			print("No")
			flg = 1
			break
if flg == 0:
	print("Yes")

Fixed submission:
N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 1:
	flg = 1
	print("No")
else:
	for i in range(int(l/2)):
		if S[i] != S[i+int(l/2)]:	
			print("No")
			flg = 1
			break
if flg == 0:
	print("Yes")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 0:
	flg = 1
	print("No")
else:
	for i in range(l/2):
		if S[i] != S[i+l/2]:	
			print("No")
			flg = 1
            break
if flg == 0:
	print("Yes")

Fixed submission:
N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 1:
	flg = 1
	print("No")
else:
	for i in range(int(l/2)):
		if S[i] != S[i+int(l/2)]:	
			print("No")
			flg = 1
			break
if flg == 0:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
S = input()
list = [100 for i in range(len(S))]
list.append(100)
cnt = 0
min = 0
if S[0] == "<":
	cnt = 1
	list[0] = 0
if S[-1] == ">":
	list[len(S)] = 0
print(S)
print(list)
for i in range(len(S)):
	if S[i] == ">" and S[i+1] == "<":
		list[i+1] = 0
		cnt = 1
	if S[i] == "<":
		list[i+1] = cnt
		cnt += 1
print("lsit",list)

for i in range(len(S)-1):
	if S[len(S) - i - 1] == ">" and S[len(S) - i - 2] == "<":
		list[len(S) - i-1] = max(list[len(S) - i-1],list[len(S) - i]+1)
	elif S[len(S) - i - 1] == ">":
		list[len(S) - i-1] = list[len(S) - i]+1		
print(list)
print(sum(list))

Fixed submission:
S = input()
list = [100 for i in range(len(S))]
list.append(100)
cnt = 0
min = 0
if S[0] == "<":
	cnt = 1
	list[0] = 0
if S[-1] == ">":
	list[len(S)] = 0
for i in range(len(S)-1):
	if S[i] == ">" and S[i+1] == "<":
		list[i+1] = 0
		cnt = 1
for i in range(len(S)):
	if S[i] == "<":
		if list[i] == 0:
			cnt = 1
		list[i+1] = cnt
		cnt += 1
#print("lsit",list)

for i in range(len(S)-1):
	if S[len(S) - i - 1] == ">" and S[len(S) - i - 2] == "<":
		list[len(S) - i-1] = max(list[len(S) - i-1],list[len(S) - i]+1)
	elif S[len(S) - i - 1] == ">":
		list[len(S) - i-1] = list[len(S) - i]+1		
if S[0] == ">":
	list[0] = list[1] + 1
#print(list)
print(sum(list))