Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
weekdays = ["", "SAT", "FRI", "THU", "WED","TUE","MON", "SUN"]
w = input()
print(weedays.index(w))


Fixed submission:
weekdays = ["", "SAT", "FRI", "THU", "WED","TUE","MON", "SUN"]
w = input()
print(weekdays.index(w))

Buggy python submission (verdict: Runtime Error):
weekdays = ["", "SAT", "FRI", "THU", "WED","TUE","MON", "SUN"]
w = input()
print(weedays.find(w))


Fixed submission:
weekdays = ["", "SAT", "FRI", "THU", "WED","TUE","MON", "SUN"]
w = input()
print(weekdays.index(w))
Buggy python submission (verdict: Runtime Error):
from math import sqrt
N = int(input()) # 2 <= N <= 10^12
# (1,1) (x,y) = x*y
a = N-1
for x in range(2, int(sqrt(N))+1):
  q, r = divmod(N, x):
  if r == 0:
    a = min(x-1 + q - 1, a)
print(a)
    
    
  
  

Fixed submission:
from math import sqrt
N = int(input()) # 2 <= N <= 10^12
# (1,1) (x,y) = x*y
a = N-1
for x in range(2, int(sqrt(N))+1):
  q, r = divmod(N, x)
  if r == 0:
    a = min(x-1 + q - 1, a)
print(a)
Buggy python submission (verdict: Runtime Error):
import sys

def solveA(S):
    N = len(S)
    count = 0
    for i in range(N-1):
        if S[i] == S[i+1]:
            S[i+1] = "_"
            count += 1
    return count

def solve(S, K):
    S0 = S[:]
    N = len(S)
    if N == 1:
        return (K-(K%2))//2
    if K < 10:
        return solveA(S*K)
    actual=(solveA(S*K))
    S1 = S0*1
    S2 = S0*2
    c1 = solveA(S1)
    c2 = solveA(S2)
    if c1 * 2 == c2:
        return c1 * K
    if S2[0] != S2[-1]:
        return c2 * (K//2) + (K%2) * c1
    else:
        a =  c2 * (K//2) + (K%2)*c1 + (K//2)-(1-K%2)
            #if a != solveA(S0*K):
            #print(c1, c2, S2[0]!=S2[-1])
            #print("c2 * (K//2) +(K%2)*c1=", c2 * (K//2)+(K%2)*c1)
        return a


def main():
    S = list(input().rstrip()) # len(S) <= 100
    K = int(input())    # K <= 10**9

    print(solve(S, K))
def test():
    import random

    for i in range(2000):
        n = random.randint(1,100)
        S = random.choices("aaaaaabcedbdddddklkjlkjdsfaak", k=n)
        S0 = S[:]
        K = random.randint(2, 30)
        SK = S*K
        a, a0 = solve(S, K), solveA(SK)
        if a != a0:
            print("".join(S0))
            print(K)
            print("actual=",a, ",expected=",a0)
            print("BAD\n")
            return
#test()
main()


Fixed submission:
import sys

def solveA(S):
    N = len(S)
    count = 0
    for i in range(N-1):
        if S[i] == S[i+1]:
            S[i+1] = "_"
            count += 1
    return count

def solve(S, K):
    S0 = S[:]
    N = len(S)
    if N == 1:
        return (K-(K%2))//2
    if K < 10:
        return solveA(S*K)
    #actual=(solveA(S*K))
    S1 = S0*1
    S2 = S0*2
    c1 = solveA(S1)
    c2 = solveA(S2)
    if c1 * 2 == c2:
        return c1 * K
    if S2[0] != S2[-1]:
        return c2 * (K//2) + (K%2) * c1
    else:
        a =  c2 * (K//2) + (K%2)*c1 + (K//2)-(1-K%2)
            #if a != solveA(S0*K):
            #print(c1, c2, S2[0]!=S2[-1])
            #print("c2 * (K//2) +(K%2)*c1=", c2 * (K//2)+(K%2)*c1)
        return a


def main():
    S = list(input().rstrip()) # len(S) <= 100
    K = int(input())    # K <= 10**9

    print(solve(S, K))
def test():
    import random

    for i in range(2000):
        n = random.randint(1,100)
        S = random.choices("aaaaaabcedbdddddklkjlkjdsfaak", k=n)
        S0 = S[:]
        K = random.randint(2, 30)
        SK = S*K
        a, a0 = solve(S, K), solveA(SK)
        if a != a0:
            print("".join(S0))
            print(K)
            print("actual=",a, ",expected=",a0)
            print("BAD\n")
            return
#test()
main()
Buggy python submission (verdict: Runtime Error):
def solve(N, M, A):
    from math import log, ceil
    from heapq import heappush, heappop, heapify
    Q = [-a for a in A]
    heapify(Q)

    if len(A) == 1:
        return A[0]>>M

    while Q and M:
        a = - heappop(Q)
        b = - Q[0]
        if b < a:
            k = min(M, ceil(log(a,2) - log(b, 2)))
        else:
            k = min(M, 1)
        c = a >> k
        #print("prev=%d, dis=%d, %d - %d = %d" % (a, c, M, k, M-k))
        M -= k
        heappush(Q, -c)
    return sum(-a for a in Q)


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

    print(solve(N, M, A))

def gen():
    import random
    with open("9", "w") as f:
        print(10**5, 10**5, file=f)
        print(*[random.randint(1, 10**9) for i in range(10**5)],file=f)

main()



Fixed submission:
def solve(N, M, A):
    from math import log, ceil
    from heapq import heappush, heappop, heapify
    Q = [-a for a in A]
    heapify(Q)

    if len(A) == 1:
        return A[0]>>M

    while Q and M:
        a = - heappop(Q)
        b = - Q[0]
        if a == 0:
            continue
        if b == 0:
            k = M
        elif b < a:
            k = min(M, ceil(log(a,2) - log(b, 2)))
        else:
            k = min(M, 1)
        c = a >> k
        #print("prev=%d, dis=%d, %d - %d = %d" % (a, c, M, k, M-k))
        M -= k
        heappush(Q, -c)
    return sum(-a for a in Q)


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

    print(solve(N, M, A))

def gen():
    import random
    with open("9", "w") as f:
        print(10**5, 10**5, file=f)
        print(*[random.randint(1, 10**9) for i in range(10**5)],file=f)

main()
Buggy python submission (verdict: Time Limit Exceeded):
def solve(S):
    print(sum(S[i] % (i+1) for i in range(N)))

N = int(input())
solve([N]+[i-1 for i in range(2, N+1)])



Fixed submission:
N = int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split()]

AB = [0] * N
for i in range(N):
    A, B = [int(x) for x in input().split()]
    AB[i] = (A, B)

# 期間が短い報酬が高い
def key(ab):
    a, b = ab
    return -b, a
AB = sorted(((a, b) for a, b in AB if a <=M), key=key)
#print(BA)

def calc(jobs, M):
    m = 0
    for d, (a, b) in enumerate(jobs):
        if d + a <= M:
            m += b
    return m

def check(N, M, AB):
    from itertools import permutations
    return max(calc(jobs, M) for jobs in permutations(AB))

def solve(N, M, AB):
    pass

def solve(N, M, AB):
    # a = 1 -> M - a
    d = M
    i = 0
    score = 0
    scheduled = set()
    for d in range(0, M+1)[::-1]:
        for i, (a, b) in enumerate(AB):
            if i in scheduled:
                continue
            #print("d=%d"%d,(a,b),d+a,end="")
            if d + a <= M:
                score += b
                #print(" score=%d"%score)
                d -= 1
                scheduled.add(i)
                break
    return score

#print("check", check(N, M, AB))
print(solve(N, M, AB))


Fixed submission:
import heapq

N, M = [int(x) for x in input().split()]
AB = [0] * N

for i in range(N):
    AB[i] = [int(x) for x in input().split()]

AB = sorted(AB)

jobs = set()
answer = 0
nextpush = 0
candidates = []

for day in range(M)[::-1]:
    while nextpush < N:
        a, b = AB[nextpush]
        if day + a <= M:
            heapq.heappush(candidates, (-b, a))
            nextpush+=1
        else:
            break
    if candidates:
        b, a = heapq.heappop(candidates)
        answer -= b
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt

def solve(N, A):
    D = int(sqrt(N))
    M = []
    for i in range(0, N, D):
        M.append(max(A[i:i+D]))
    M.append(0)
    for i in range(0, N):
        d = i // D
        l = d*D
        m = 0
        for j in range(l, min(l+D, N)):
            if i != j and A[j] > m:
                m = A[j]
        m0 = m
        if d == 0:
            m = max(m, max(M[d+1:]))
        elif d >= len(M) - 1:
            m = max(m, max(M[:d]))
            pass
        else:
            #print(d, len(M))
            #print("M[:d]", M[:d])
            #print("M[d+1:]", M[d+1:])
            m = max(m, max(M[:d]), max(M[d+1:]))
        print(m)
        #print("d=%d,"%d, m, max(A[:i]+A[i+1:]))
        #assert m == max(A[:i]+A[i+1:])


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    solve(N, A)

#l = list(range(1, 200))
#solve(len(l), l)
main()


Fixed submission:
from math import sqrt

def solve0(N, A):
    S = sorted(A)
    S0 = S[-1]
    S1 = S[-2]

    for a in A:
        if a == S0:
            print(S1)
        else:
            print(S0)

def solve(N, A):
    D = int(sqrt(N))
    M = []
    for i in range(0, N, D):
        M.append(max(A[i:i+D]))
    M.append(0)
    for i in range(0, N):
        d = i // D
        l = d*D
        m = 0
        for j in range(l, min(l+D, N)):
            if i != j and A[j] > m:
                m = A[j]
        m0 = m
        if d == 0:
            m = max(m, max(M[d+1:]))
        elif d >= len(M) - 1:
            m = max(m, max(M[:d]))
            pass
        else:
            #print(d, len(M))
            #print("M[:d]", M[:d])
            #print("M[d+1:]", M[d+1:])
            m = max(m, max(M[:d]), max(M[d+1:]))
        print(m)
        #print("d=%d,"%d, m, max(A[:i]+A[i+1:]))
        #assert m == max(A[:i]+A[i+1:])


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    solve0(N, A)

#l = list(range(1, 200))
#solve(len(l), l)
main()
Buggy python submission (verdict: Runtime Error):
from math import log


def solve(A, N):
    r = N // 2
    l = N
   
    M = set()
    for i in range(r, l):
        if A[i]:
            M.add(i)
    l = r
    r //=2

    while l > 0:
        for i in range(r, l):
            if A[i] and A[i<<1]:
                M.add(i)
                A[i] = 1
            else:
                A[i] = 0
        l = r
        r //=2

    return M


def main():
    N = int(input())
    X = [0] * (2**15)
    A = [int(x) for x in input().split()]
    for i in range(len(A)):
        X[i] = A[i]
    m = solve(X, 2**15)
    print(len(m))
    for i in m:
        print(i+1)

main()


Fixed submission:


def solve(A, N):
    B = [0] * len(A)
    for i in range(1, N+1)[::-1]:
        A2 = A[i*2] if i*2 <= N else 0
        x = A[i]
        for j in range(i*2, N+1, i):
            x ^= B[j]
        B[i] = x
    return B

#from random import randint
#solve([0] + list(randint(0, 1) for _ in range(1000)), 1000)
def main():
    N = int(input())
    A = [0] + [int(x) for x in input().split()]
    B = solve(A, N)
    print(sum(B))
    for i in range(1, N+1):
        if B[i]:
            print(i)

main()
Buggy python submission (verdict: Runtime Error):
from math import gcd

def debug(*args):
    import sys
    #print(*args, file=sys.stderr)

def solve(A, B, C, D):
    L = C * D // gcd(C, D)
    A-=1
    debug("A=%d, B=%d, C=%d, D=%d" %(A,B,C,D))
    debug((B//C, A//C), (B//D, A//D) , (B//L , A//L))
    debug((B//C - A//C), (B//D - A//D) , (B//L - A//L))
    return B-A- ((B//C - A//C) + (B//D - A//D) - (B//L - A//L))

def main():
    A, B, C, D = [int(x) for x in input().split()]
    print(solve(A, B, C, D))
    pass

main()



Fixed submission:
from fractions import gcd

def debug(*args):
    import sys
    #print(*args, file=sys.stderr)

def solve(A, B, C, D):
    L = C * D // gcd(C, D)
    A-=1
    debug("A=%d, B=%d, C=%d, D=%d" %(A,B,C,D))
    debug((B//C, A//C), (B//D, A//D) , (B//L , A//L))
    debug((B//C - A//C), (B//D - A//D) , (B//L - A//L))
    return B-A- ((B//C - A//C) + (B//D - A//D) - (B//L - A//L))

def main():
    A, B, C, D = [int(x) for x in input().split()]
    print(solve(A, B, C, D))
    pass

main()
Buggy python submission (verdict: Runtime Error):
from collections import Counter
def solve(N, XY):
    XY = sorted(XY)
    cnt = Counter()
    d = []
    for x0, y0 in XY:
        for x1, y1 in XY:
            if x0 == x1 and y0 == y1:
                continue
            d.append((x0 - x1, y0 - y1))
    m = Counter(d).most_common()[0]
    return len(XY) - m[1]

def main():
    N = int(input())

    XY = []
    for i in range(N):
        XY.append(tuple([int(x) for x in input().split()]))

    print(solve(N, XY))

main()



Fixed submission:
from collections import Counter
def solve(N, XY):
    if N == 1:
        return 1
    XY = sorted(XY)
    cnt = Counter()
    d = []
    for x0, y0 in XY:
        for x1, y1 in XY:
            if x0 == x1 and y0 == y1:
                continue
            d.append((x0 - x1, y0 - y1))
    m = Counter(d).most_common()[0]
    return len(XY) - m[1]

def main():
    N = int(input())

    XY = []
    for i in range(N):
        XY.append(tuple([int(x) for x in input().split()]))

    print(solve(N, XY))

main()

Buggy python submission (verdict: Runtime Error):
from collections import Counter
def solve(N, XY):
    XY = sorted(XY)
    cnt = Counter()
    d = []
    for (x0, y0), (x1, y1) in zip(XY, XY[1:]):
        d.append((x0 - x1, y0 - y1))
    m = Counter(d).most_common()[0]
    return len(XY) - m[1]

def main():
    N = int(input())

    XY = []
    for i in range(N):
        XY.append(tuple([int(x) for x in input().split()]))

    print(solve(N, XY))

main()



Fixed submission:
from collections import Counter
def solve(N, XY):
    if N == 1:
        return 1
    XY = sorted(XY)
    cnt = Counter()
    d = []
    for x0, y0 in XY:
        for x1, y1 in XY:
            if x0 == x1 and y0 == y1:
                continue
            d.append((x0 - x1, y0 - y1))
    m = Counter(d).most_common()[0]
    return len(XY) - m[1]

def main():
    N = int(input())

    XY = []
    for i in range(N):
        XY.append(tuple([int(x) for x in input().split()]))

    print(solve(N, XY))

main()
Buggy python submission (verdict: Runtime Error):
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if A[1]:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if A[s] == 0:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1]) % 1000000007
    print(answer[N])

N, M = [int(x) for x in input().strip().split()]
A = [1] * N
for _ in range(M):
    A[int(input())] = 0
solve(N, M, A)



Fixed submission:
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1]) % 1000000007
    print(answer[N])

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input()))
solve(N, M, A)

Buggy python submission (verdict: Runtime Error):
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1])
    print(answer[N] % 1000000007)

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input().split()))
solve(N, M, A)



Fixed submission:
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1]) % 1000000007
    print(answer[N])

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input()))
solve(N, M, A)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split()]
def check(n, LR):
  return 1 if all(l <= n <=r for l, r in LR) else 0

LR = []
for _ in range(M):
  LR.append([int(x) for x in input().split()])

print(sum(check(n, LR) for n in range(1, N+1)))


Fixed submission:
N, M = [int(x) for x in input().split()]

def check(n, LR):
    return 1 if all(l <= n <=r for l, r in LR) else 0

L = 0
R = N
for _ in range(M):
    l, r = [int(x) for x in input().split()]
    if L < l:
        L = l
    if r < R:
        R = r

if L <= R:
    print(R - L + 1)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
N, M = [int(x) for x in input().split()]

LR = []
for _ in range(M):
  LR.append([int(x) for x in input().split()])

print(sum(check(n) for n in range(1, N+1)))
def check(n):
  return 1 if all(l <= n <=r for l, r in range LR) else 0


Fixed submission:
N, M = [int(x) for x in input().split()]

def check(n, LR):
    return 1 if all(l <= n <=r for l, r in LR) else 0

L = 0
R = N
for _ in range(M):
    l, r = [int(x) for x in input().split()]
    if L < l:
        L = l
    if r < R:
        R = r

if L <= R:
    print(R - L + 1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
# N < 10000
N = int(input())

# len(s) < 10

count = 0
a, b, ba = 0, 0, 0
for i in range(N):
    s = input().rstrip()
    count += s.count("AB")

    if s[-1] == 'A':
        if s[0] == 'B':
            ba += 1
        else:
            a += 1
    elif s[0] == 'B':
        b += 1

#e = int(input())
#print("*A=",a, ", B*=",b, "B*A=",ba, ",AB=", count, ",expected=", e)

if ba > 1:
    count += ba - 1
    ba = 1

if ba == 1:
    c0 = 1 + min(a, b)
count+=max(min(a+ba,b),min(a,b+ba), c0)
print(count)


Fixed submission:
# N < 10000
N = int(input())

# len(s) < 10

count = 0
a, b, ba = 0, 0, 0
for i in range(N):
    s = input().rstrip()
    count += s.count("AB")

    if s[-1] == 'A':
        if s[0] == 'B':
            ba += 1
        else:
            a += 1
    elif s[0] == 'B':
        b += 1

#e = int(input())
#print("*A=",a, ", B*=",b, "B*A=",ba, ",AB=", count, ",expected=", e)

if ba > 1:
    count += ba - 1
    ba = 1

if a + b > 0:
    #count += max(min(a + ba, b),min (a, b + ba))
    count += min(a,b) + ba
print(count)

Buggy python submission (verdict: Runtime Error):
# N < 10000
N = int(input())

# len(s) < 10

count = 0
a, b, ba = 0, 0, 0
for i in range(N):
    s = input().rstrip()
    i = 0
    while True:
        i = s.find("AB", i)
        if i < 0:
            break
        i += 2
        count+=1

    if s[-1] == 'A':
        if s[0] == 'B':
            ba += 1
        else:
            a += 1
    elif s[0] == 'B':
        b += 1

e = int(input())
#print("*A=",a, ", B*=",b, "B*A=",ba, ",AB=", count, ",expected=", e)

if ba > 1:
    count += ba - 1
    ba = 1
count+=max(min(a+ba,b),min(a,b+ba))
print(count)









Fixed submission:
# N < 10000
N = int(input())

# len(s) < 10

count = 0
a, b, ba = 0, 0, 0
for i in range(N):
    s = input().rstrip()
    count += s.count("AB")

    if s[-1] == 'A':
        if s[0] == 'B':
            ba += 1
        else:
            a += 1
    elif s[0] == 'B':
        b += 1

#e = int(input())
#print("*A=",a, ", B*=",b, "B*A=",ba, ",AB=", count, ",expected=", e)

if ba > 1:
    count += ba - 1
    ba = 1

if a + b > 0:
    #count += max(min(a + ba, b),min (a, b + ba))
    count += min(a,b) + ba
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input()
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
        
print(
  sum(
    max(v - c, 0) for v, c in zip(V,C)
  )
)

Fixed submission:
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
            
print(
  sum(
    max(v - c, 0) for v, c in zip(V,C)
  )
)
Buggy python submission (verdict: Runtime Error):
N = int(input())
# N < 10 ** 5
A = sorted([int(x) for x in input().split()])
# - 10 ** 9 < A < 10 ** 9

B = [-a for a in A if a < 0]
D = [a for a in A if a >= 0]

if len(B) % 2 == 1:
    B[-1] = -B[-1]
    if -B[-1] > D[0]:
        B[-1] = -B[-1]
        D[0] = -D[0]

print(sum(B)+sum(D))


Fixed submission:
N = int(input())
# N < 10 ** 5
A = sorted([int(x) for x in input().split()])
# - 10 ** 9 < A < 10 ** 9

B = [-a for a in A if a < 0]
D = [a for a in A if a >= 0]

if len(B) % 2 == 1:
    B[-1] = -B[-1]
    if D and -B[-1] > D[0]:
        B[-1] = -B[-1]
        D[0] = -D[0]

print(sum(B)+sum(D))
Buggy python submission (verdict: Runtime Error):
N = input()
if N == '1':
  print("Hello World")
else:
  print(int(input()) + int(input())

Fixed submission:
N = input()
if N == '1':
  print("Hello World")
else:
  print(int(input()) + int(input()))
Buggy python submission (verdict: Runtime Error):
N, T = [int(x) for x in input().strip()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().strip()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)


Fixed submission:
N, T = [int(x) for x in input().split()]

ok = 2000
for _ in range(N):
  c, t = [int(x) for x in input().split()]
  if t <= T:
    ok = min(ok, c)

print("TLE" if ok == 2000 else ok)
Buggy python submission (verdict: Runtime Error):
N = int(input())                                                                                                                                                                                                  
for i in range(N):
    W.append(input())

prev = W[0]

answer = "Yes"

for w in W[1:]:
    if prev[-1] != w[0]:
        answer = "No"

print(answer)                                                           

Fixed submission:
N = int(input())
words = [input().strip() for _ in range(N)]

def solve(words):
  s = {words[0]}
  for p, w in zip(words, words[1:]):
    if p[-1] != w[0]:
      return "No"
    if w in s:
      return "No"
    s.add(w)
  return "Yes"

print(solve(words))
Buggy python submission (verdict: Runtime Error):
N = int(input())

even = N // 2
odd = N - even
print(event * odd)

Fixed submission:
N = int(input())

even = N // 2
odd = N - even
print(even * odd)
Buggy python submission (verdict: Runtime Error):
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == Si[i:] + S1[:i]:
    ok = "Yes"
print(ok)

Fixed submission:
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == S1[i:] + S1[:i]:
    ok = "Yes"
print(ok)
Buggy python submission (verdict: Runtime Error):
print(sum({'+':1,'-':-1} for c in input()))

Fixed submission:
print(sum({'+':1,'-':-1}[c] for c in input()))
Buggy python submission (verdict: Time Limit Exceeded):
def key(k):
    return (len(k), k)    

def solve(S, K):
    ss = set()
    for k in range(1, len(S)+1): 
        for i in range(0, len(S)-k+1):
            ss.add(S[i:i+k])
    ss = sorted(ss)
    return ss[K-1]
    
S = input().strip()
K = int(input())

print(solve(S, K))


Fixed submission:
S = input()
# 5000
K = int(input())
# K < 5

s = []
for i in range(len(S)):
    for k in range(1,K+1):
        s.append(S[i:i+k])

print(sorted(set(s))[K-1])
Buggy python submission (verdict: Runtime Error):
def solve(H, W, S):
    for h in range(1, H):
        for w in range(1, W):
            if S[h][w] == '#':
                if not (S[h-1][w] == '#' or S[h+1][w] == '#' or S[h][w+1] == '#' or S[h][w-1] == '#'):
                    return "No"
    return "Yes"


H, W = [int(x) for x in input().split()]
# H, W < 50
S = []
S.append('.' * (H+2))
for _ in range(H):
    S.append("."+input().strip()+".")
S.append('.' * (H+2))
print(solve(H, W, S))



Fixed submission:
def solve(H, W, S):
    for h in range(1, H):
        for w in range(1, W):
            if S[h][w] == '#':
                if not (S[h-1][w] == '#' or S[h+1][w] == '#' or S[h][w+1] == '#' or S[h][w-1] == '#'):
                    return "No"
    return "Yes"


H, W = [int(x) for x in input().split()]
# H, W < 50
S = []
S.append('.' * (W+2))
for _ in range(H):
    S.append("."+input().strip()+".")
S.append('.' * (W+2))
import sys
for row in S:
    print(row, file=sys.stderr)
print(solve(H, W, S))