Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(K):
    sum += l[i]

print(sum)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input()))

l.sort(reverse=True)

sum = 0

for i in range(K):
    sum += l[i]

print(sum)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input()))

l.sort()

print(l[-1]+l[len(l)-2]+l[len(l)-3])

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input()))

l.sort()

print(l[-1]+l[-2]+l[-3])

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)
Buggy python submission (verdict: Runtime Error):
from collections import deque
N = int(input())
a = list(map(int,input().split()))
value = []
for i in range(2,N):
    x = sum(a[0:i])
    y = sum(a[i:N])
    value.append(abs(x-y))

print(min(value))


Fixed submission:

N = int(input())
a = list(map(int,input().split()))
x = a[0]
y = sum(a[1:])
ans = abs(x-y)
for i in range(1,N-1):
    x += a[i]
    y -= a[i]
    ans = min(abs(x-y),ans)

print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import deque
N = int(input())
a = list(map(int,input().split()))
value = deque()
for i in range(2,N):
    x = sum(a[0:i])
    y = sum(a[i:N])
    value.append(abs(x-y))
print(min(value))


Fixed submission:

N = int(input())
a = list(map(int,input().split()))
x = a[0]
y = sum(a[1:])
ans = abs(x-y)
for i in range(1,N-1):
    x += a[i]
    y -= a[i]
    ans = min(abs(x-y),ans)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))
x = 0
y = 0
min = abs(sum(a[0:1])-sum(a[1:N]))
for i in range(3,N):
    x = sum(a[0:i])
    y = sum(a[i:N])
    if abs(x-y) <= min:
        min = abs(x-y)
print(min)


Fixed submission:

N = int(input())
a = list(map(int,input().split()))
x = a[0]
y = sum(a[1:])
ans = abs(x-y)
for i in range(1,N-1):
    x += a[i]
    y -= a[i]
    ans = min(abs(x-y),ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(str,input().split()))
b = []

for i in a:
    b.append(i)
    b.reverse()

print(' '.join(b))

Fixed submission:
from collections import deque
n = int(input())
a = list(map(str,input().split()))
d = deque()

for i in range(len(a)):
    if i%2==0:
        d.append(a[i])
    else:
        d.appendleft(a[i])

if n%2==1:
    d.reverse()

print(' '.join(d))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]

a.sort()

print(a[-1]-a[0])

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

a.sort()

print(a[-1]-a[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))

color = [0]*8
count = 0

for i in a:
    if a < 400:
        color[0] = 1
    elif a < 800:
        color[1] = 1
    elif a < 1200:
        color[2] = 1
    elif a < 1600:
        color[3] = 1
    elif a < 2000:
        color[4] = 1
    elif a < 2400:
        color[5] = 1
    elif a < 2800:
        color[6] = 1
    elif a < 3200:
        color[7] = 1
    else:
        count += 1
sum_color = sum(color)

if sum_color == 0:
    print(1,count)
else:
    print(sum_color,sum_color+count)

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

color = [0]*8
count = 0

for a in A:
    if a < 400:
        color[0] = 1
    elif a < 800:
        color[1] = 1
    elif a < 1200:
        color[2] = 1
    elif a < 1600:
        color[3] = 1
    elif a < 2000:
        color[4] = 1
    elif a < 2400:
        color[5] = 1
    elif a < 2800:
        color[6] = 1
    elif a < 3200:
        color[7] = 1
    else:
        count += 1
sum_color = sum(color)

if sum_color == 0:
    print(1,count)
else:
    print(sum_color,sum_color+count)
Buggy python submission (verdict: Runtime Error):
S = list(input())
s = set(S)

if len(s) == len(S):
    print('yes')
else:
    prirnt('no')

Fixed submission:
S = list(input())
s = set(S)

if len(s) == len(S):
    print('yes')
else:
    print('no')

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

if len(s) == len(S):
    print('yes')
else:
    prirnt('no')

Fixed submission:
S = list(input())
s = set(S)

if len(s) == len(S):
    print('yes')
else:
    print('no')
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
value = []
ans = [0]*M
for i in range(M):
    a,b = map(int,input().split())
    value.append([a,b])
    ans[a-1] += 1
    ans[b-1] += 1

for i in ans:
    print(i)



Fixed submission:
N,M = map(int,input().split())
ans = [0]*N
for i in range(M):
    a,b = map(int,input().split())
    ans[a-1] += 1
    ans[b-1] += 1

for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
array = []

for i in range(N):
    a,b = map(int,input().split())
    for i in range(b):
        array.append(a)
array.sort()
print(array[K-1])

Fixed submission:
N,K = map(int,input().split())
array = []
sum = 0
for i in range(N):
    a,b = map(int,input().split())
    array.append([a,b])
array.sort(key = lambda x:x[0])
for i in range(N):
    sum += array[i][1]
    if sum >= K:
        print(array[i][0])
        exit()
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input())
sum = A+B

if sum >= 24:
    print(sum-24)
else:
    print(sum)

Fixed submission:
A,B = map(int,input().split())
sum = A+B

if sum >= 24:
    print(sum-24)
else:
    print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
cnt = 0
while N >= 0 or M > 1:
    if N >= 1:
        if M >= 2:
            M -= 2
            N -= 1
            cnt += 1
        else:
            print(cnt)
            exit()
    else:
        if M >= 4:
            M -= 4
            cnt += 1
        else:
            print(cnt)
            exit()

Fixed submission:
N,M = map(int,input().split())
cnt = 0

m = int(M/2)

if N >= m:
    cnt = m
elif m > N:
    cnt = N
    M -= 2*N
    cnt += int(M/4)

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
res = 1
for i in range(N):
    res *= A[i]
if res > 10**18:
    print(-1)
else:
    print(res)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
res = A[0]
for i in range(1,N):
    res *= A[i]
    if res > 10**18:
        print(-1)
        exit()
print(res)
Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int, input().split())
res = A*B
print(math.floor(res))

Fixed submission:
import math
from decimal import *
exp = Decimal(10**23)
A,B = map(str, input().split())
res = int(A)*Decimal(B)
print(math.floor(res))
Buggy python submission (verdict: Time Limit Exceeded):
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
X = int(input())
div = divisor(X)
div.sort()
for i in range(len(div)):
    if X < 0:
        a = 0
        b = -1
        while a**5 - (b**5) != X or abs(a**5 - (b**5)) < abs(X):
            a = a-1
            b += 1
    else:
        a = 1
        b = 0
        while a**5 - (b**5) != X or a**5 - (b**5) < X:
            a += 1
            b = b-1
print(a,b)

Fixed submission:
x = int(input())
for i in range(-200,200):
    for j in range(-200,200):
        if i**5 - j**5 == x:
            print(i,j)
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    print(A.count(i+1))

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

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(str, input().split()))
for i in range(N):
    print(A.count(str(i+1)))

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
L = collections.Counter(A)
for i in range(N):
    print(L[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
flag = 0   #"1" represents inversion
for i in range(Q):
    quary = list(map(str, input().split()))
    if quary[0] == "1":
        if flag == 0:
            flag = 1
        else:
            flag = 0
    else:
        if flag == 1:
            if quary[1] == "1":
                S = S+quary[2]
            else:
                S = quary[2]+S
        else:
            if quary[1] == "1":
                S = quary[2]+S
            else:
                S = S+quary[2]
if flag == 1:
    S = S[::-1]
print(S)

Fixed submission:
S = input()
Q = int(input())
flag = 0   #"1" represents inversion
head = ""
tail = ""
for i in range(Q):
    quary = list(map(str, input().split()))
    if quary[0] == "1":
        if flag == 0:
            flag = 1
        else:
            flag = 0
    else:
        if flag == 1:
            if quary[1] == "1":
                tail = tail+quary[2]
            else:
                head = quary[2]+head
        else:
            if quary[1] == "1":
                head = quary[2]+head
            else:
                tail = tail+quary[2]
S = head+S+tail
if flag == 1:
    S = S[::-1]
print(S)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
flag = 0   #"1" represents inversion
for i in range(Q):
    quary = list(map(str, input().split()))
    if quary[0] == "1":
        if flag == 0:
            flag = 1
        else:
            flag = 0
    else:
        if flag == 1:
            if quary[1] == "1":
                S = S+quary[2]
            else:
                S = quary[2]+S
        else:
            if quary[1] == "1":
                S = quary[2]+S
            else:
                S = S+quary[2]
if flag == 1:
    S = S[::-1]
print(S)

Fixed submission:
S = input()
Q = int(input())
flag = 0   #"1" represents inversion
head = ""
tail = ""
for i in range(Q):
    quary = list(map(str, input().split()))
    if quary[0] == "1":
        if flag == 0:
            flag = 1
        else:
            flag = 0
    else:
        if flag == 1:
            if quary[1] == "1":
                tail = tail+quary[2]
            else:
                head = quary[2]+head
        else:
            if quary[1] == "1":
                head = quary[2]+head
            else:
                tail = tail+quary[2]
S = head+S+tail
if flag == 1:
    S = S[::-1]
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if min(P[0:i+1]) == P[i]:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
cnt = 0
min_n = P[0]
for i in range(N):
    if min_n >= P[i]:
        cnt += 1
        min_n = P[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
s,t = str(input())
print(t+s)

Fixed submission:
s,t = str(input()).split()
print(t+s)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int, input().split())
for i in range(k):
    if a > 0:
        a -= 1
    elif b > 1:
        b -= 1
print(a,b)

Fixed submission:
a,b,k = map(int, input().split())
if k >= a:
    k = k-a
    a = 0
else:
    a -= k
    k = 0

if k >= b:
    b = 0
else :
    b -= k
print(a,b)
Buggy python submission (verdict: Runtime Error):
S = input()
d1 = ""
d2 = ""
res = 0
for i in range(len(S)):
  d1 += s[i]
  if d1 != d2:
    d2 = d1
    d1 = ""
    res += 1
print(res)

Fixed submission:
S = input()
d1 = ""
d2 = ""
res = 0
for i in range(len(S)):
  d1 += S[i]
  if d1 != d2:
    d2 = d1
    d1 = ""
    res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
cc = []
res = s[0]
for i in range(1,N):
    res^ = a[i]
if res == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
cc = []
res = a[0]
for i in range(1,N):
    res ^= a[i]
if res == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
cc = []
res = s[0]
for i in range(1,N):
    res^ = s[i]
if res == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
cc = []
res = a[0]
for i in range(1,N):
    res ^= a[i]
if res == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())
a.sort()
print(a[0]+a[1])

Fixed submission:
a = list(map(int, input().split()))
a.sort()
print(a[0]+a[1])

Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())
a.sort
print(a[0]+a[1])

Fixed submission:
a = list(map(int, input().split()))
a.sort()
print(a[0]+a[1])
Buggy python submission (verdict: Runtime Error):
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
for i in range(len(A)):
    if 0 < A[i]%10 < Max:
        Max = A[i]%10
        Max_i = i
for i in range(len(A)):
    if i != Max_i:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max_i])

Fixed submission:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
Max_i = 0
for i in range(len(A)):
    if 0 < A[i]%10 < Max:
        Max = A[i]%10
        Max_i = i
for i in range(len(A)):
    if i != Max_i:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max_i])
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
div_1 = []
div_res = []
for i in range(A):
    if i != 0 and A%i == 0:
        div_1.append(i)
for i in range(B):
    if i != 0 and B%i == 0 and i in div_1:
        div_res.append(i)
print(div_res[K-1])

Fixed submission:
A,B,K = map(int, input().split())
div_1 = []
div_res = []
for i in range(A+1):
    if i != 0 and A%i == 0:
        div_1.append(i)
for i in range(B+1):
    if i != 0 and B%i == 0 and (i in div_1):
        div_res.append(i)
div_res.reverse()
print(div_res[K-1])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
div_1 = []
div_res = []
for i in range(1,A):
    if A%i == 0:
        div_1.append(i)
for i in range(1,B):
    if B%i == 0 and i in div_1:
        div_res.append(i)
print(div_res[K-1])

Fixed submission:
A,B,K = map(int, input().split())
div_1 = []
div_res = []
for i in range(A+1):
    if i != 0 and A%i == 0:
        div_1.append(i)
for i in range(B+1):
    if i != 0 and B%i == 0 and (i in div_1):
        div_res.append(i)
div_res.reverse()
print(div_res[K-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
res = 0
for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        res += int(x)
    else:
        res += int(x)*380000
print(res)

Fixed submission:
N = int(input())
res = 0
for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        res += int(x)
    else:
        res += float(x)*380000
print(res)
Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
res = [0]
for i in range(N):
    K = list(map(int, input().split()))
    for j in K:
        res[K-1] = 1
print(M-res.count(0))

Fixed submission:
N,M = map(int, input().split())
res = [0]*M
for i in range(N):
    A = list(map(int, input().split()))
    K = A[0]
    for j in range(1,K+1):
        res[A[j]-1] += 1
print(res.count(N))
Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
L = []
for i in range(1,M):
    L.append(X[i]-X[i-1])
L.sort()
L.reverse()
res = sum(L)
for i in range(N-1):
    res -= L[i]
print(res)

Fixed submission:
N,M = map(int, input().split())
X = list(map(int, input().split()))
if M <= N:
    print(0)
    exit()
X.sort()
L = []
for i in range(1,M):
    L.append(X[i]-X[i-1])
L.sort()
L.reverse()
res = sum(L)
for i in range(N-1):
    res -= L[i]
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = []
for i in range(N):
    P.append(int(input))
print(sum(P)-max(P)//2)

Fixed submission:
N = int(input())
P = []
for i in range(N):
    P.append(int(input()))
print(sum(P)-max(P)//2)
Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
h = []
for i in range(N):
    h.append(int(input()))
h.sort()
dif = []
for i in range(N-1):
    dif[i] = h[i+1]-h[i]
print(min(dif))

Fixed submission:
N,K = map(int, input().split())
h = []
for i in range(N):
    h.append(int(input()))
h.sort()
res = 10**9
for i in range(N-K+1):
    if res > h[i+K-1]-h[i]:
        res = h[i+K-1]-h[i]
print(res)
Buggy python submission (verdict: Runtime Error):
import math
N, M = list(map(int, input().split()))
S = input()
T = input()
d = math.gcd(N,M)
n = N//d
m = M//d
for i in range(d):
    if S[i*n] != T[i*m]:
        flag = False
        break
    else:
        flag = True
if flag:
  print((N*M)//d)
else:
  print(-1)

Fixed submission:
import fractions
N, M = list(map(int, input().split()))
S = input()
T = input()
d = fractions.gcd(N,M)
n = N//d
m = M//d
for i in range(d):
    if S[i*n] != T[i*m]:
        flag = False
        break
    else:
        flag = True
if flag:
  print((N*M)//d)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
 N,x = map(int, input().split())
 a = list(map(int, input().split()))
 a.sort()
 for i in range(N):
     x -= a[i]
     if x < 0:
         print(i+1)
         exit()
print(N)

Fixed submission:
N,x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
res = 0
for i in range(N):
    x -= a[i]
    if x < 0:
        break
    res += 1
if x > 0:
    res -= 1
print(res)
Buggy python submission (verdict: Runtime Error):
S = list(input())
K = int(input())
for i in range(len(K)):
    if S[i] != 1:
        print(S[i])
        exit()
print(1)

Fixed submission:
S = list(input())
K = int(input())
for i in range(min(len(S),K)):
    if S[i] != "1":
        print(int(S[i]))
        exit()
print(1)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
if S == T or S.reverse == T:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
T = input()
for i in range(len(S)):
    if S == T:
        print("Yes")
        exit()
    else:
        S = S[-1]+S[:-1]
print("No")
Buggy python submission (verdict: Runtime Error):
N = list(input())
if N%10 != 0:
    res = 0
    for i in range(len(N)):
        res += int(N[i])
else:
    res = 10
print(res)

Fixed submission:
N = list(input())
if int(''.join(N))%10 != 0:
    res = 0
    for i in range(len(N)):
        res += int(N[i])
else:
    res = 10
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = map(int, input().split())
MAX = 10**18
for i in range(K):
    temp_a = A
    temp_b = B
    temp_c = C
    A = temp_b + temp_c
    B = temp_a + temp_c
    C = temp_a + temp_b
if abs(A-B) > MAX:
    print("Unfair")
else:
    print(A-B)

Fixed submission:
A,B,C,K = map(int, input().split())
MAX = 10**18
if abs(A-B) > MAX:
    print("Unfair")
elif K%2:
    print(B-A)
else:
    print(A-B)
Buggy python submission (verdict: Runtime Error):
s =i nput()
if len(s) < 26:
    for i in range(26):
        c = chr(ord("a")+i)
        if c not in s:
            print(s+c)
            exit()
else:
    for i in reversed(range(1,26)):
        if s[i-1] < s[i]:
            s1 = s[0:i-1]
            for j in range(26):
                c = chr(ord("a")+j)
                if c > s[i-1] and c not in s1:
                    print(s1+c)
                    exit()
    print(-1)

Fixed submission:
s = input()
if len(s) < 26:
    for i in range(26):
        c = chr(ord("a")+i)
        if c not in s:
            print(s+c)
            exit()
else:
    for i in reversed(range(1,26)):
        if s[i-1] < s[i]:
            s1 = s[0:i-1]
            for j in range(26):
                c = chr(ord("a")+j)
                if c > s[i-1] and c not in s1:
                    print(s1+c)
                    exit()
    print(-1)

Buggy python submission (verdict: Runtime Error):
S = list(input())
c = set(S)
all_ar = list("abcdefghijklmnopqrstuvwxyz")
if len(c) == 26:
    print(-1)
    exit()
for i in range(26):
    if not all_ar[i] in c:
        print(''join(S)+all_ar[i])
        exit()

Fixed submission:
s = input()
if len(s) < 26:
    for i in range(26):
        c = chr(ord("a")+i)
        if c not in s:
            print(s+c)
            exit()
else:
    for i in reversed(range(1,26)):
        if s[i-1] < s[i]:
            s1 = s[0:i-1]
            for j in range(26):
                c = chr(ord("a")+j)
                if c > s[i-1] and c not in s1:
                    print(s1+c)
                    exit()
    print(-1)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
cnt = 0
for i in range(A,B+1):
    if str(i) == str(i).reverse():
        cnt += 1
print(cnt)

Fixed submission:
A,B = map(int, input().split())
cnt = 0
for i in range(A,B+1):
    if str(i) == (str(i))[::-1]:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in len(N):
    A.append(int(input()))
print(len(set(A)))

Fixed submission:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
print(len(set(A)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in len(N):
    A.append(int(input))
print(len(set(A)))

Fixed submission:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
print(len(set(A)))
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
S = list(input())
for i in range(A):
    if not 0 <= int(S[i]) <= 9:
        print("No")
        exit()
if S[A] != "-":
    print("No")
    exit()
for i in range(A+1,B):
    if not 0 <= int(S[i]) <= 9:
        print("No")
        exit()
print("Yes")

Fixed submission:
A,B = map(int,input().split())
S = list(input())
if S[A] == '-' and S.count('-') == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = list(map(str, input().split()))
if S == S.soreted():
    print("<")
else:
    print(">")

Fixed submission:
S = list(map(str, input().split()))
if S[0] == S[1]:
    print("=")
    exit()
if S == sorted(S):
    print("<")
else:
    print(">")
Buggy python submission (verdict: Runtime Error):
R,G = map(int, input().split())
print(2*G-R)

Fixed submission:
R = int(input())
G = int(input())
print(2*G-R)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for i in range(N):
    n = int(input())
    if not (n in A):
        A.append(n)
    else:
        A.remove(n)
print(len(A))

Fixed submission:
N = int(input())
A = set()
for i in range(N):
    n = int(input())
    if not (n in A):
        A.add(n)
    else:
        A.remove(n)
print(len(A))
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())), reverse = True)
l = 0
ln = []
for a in A:
    if l == a:
        ln.append(a)
        l = 0
    else:
        l = a
    if len(ln) == 2:
        break
if len(ln) == 2:
    print(ln[0]*ln[1])
else:
    print(0)

Fixed submission:
x,a,b = map(int, input().split())
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")
Buggy python submission (verdict: Runtime Error):
S = list(input())
All = list("abcdefghijklmnopqrstuvwxyz")
res = list(set(S) ^ set(All))
print(res[0])

Fixed submission:
S = list(input())
All = list("abcdefghijklmnopqrstuvwxyz")
res = list(set(S) ^ set(All))
if len(res) > 0:
    print(res[0])
else:
    print("None")