Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, k = map(long, input().split())
a = list(map(long, input().split()))
mod = 10**9 + 7
ans = 0
fflag = 0
bflag = 0

for i in range(n):
    for j in range(n):
        if i > j:
            if a[i] > a[j]:
                fflag += 1
        if i < j:
            if a[i] > a[j]:
                bflag += 1

ans = (long((fflag+bflag)*k*(k+1)/2) - fflag*k)%mod
print(ans)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0
fflag = 0
bflag = 0

for i in range(n):
    for j in range(n):
        if i > j:
            if a[i] > a[j]:
                fflag += 1
        elif i < j:
            if a[i] > a[j]:
                bflag += 1

ans = ((fflag+bflag)*k*(k+1)//2 - fflag*k)%mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def init_dict():
    global dic
    dic = {
        "a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0
    }

def countchar(st: str):
    global dic
    global anls
    cp = dic.copy()
    for i in range(10):
        cp[st[i]] += 1
    anls.append(cp)

def search(ls:list):
    global ans
    for i in range(len(ls)-1):
        if ls[i] == ls[len(ls)-1]:
            ans += 1

def main():
    global dic
    global anls
    global ans
    n = int(input())
    dic = {
        "a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0
    }
    anls = []
    ans = 0

    for i in range(n):
        s = input()
        init_dict()
        countchar(s)
        search(anls)
    
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom

def main(): 
    n = int(input())
    s = []
    dic = {}
    ans = 0
    for i in range(n):
        b = ""
        a = sorted(input())
        for j in range(len(a)):
            b += str(a[j])
        s.append(b)
        if b in dic:
            dic[str(b)] = dic[str(b)] + 1
        else:
            dic[str(b)] = 1

    for key in dic:
        if dic[key] > 1:
            ans += ncr(dic[key], 2)
    
    print(int(ans))
    # print(dic)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a,b,c = map(nt, input().split())

ans = a

if a > b+c:
  ans = b+c

print(ans)

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

ans = 0

if a < b+c:
  ans = c-(a-b)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

ans = "Yes"

for i in range(n):
    for j in range(i):    
        if h[i] < h[j]-1:
            ans = "No"
            break

print(ans)


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

ans = "Yes"
max = h[0]

for i in range(n):
    if h[i] < max-1:
        ans = "No"
    if h[i] > max:
        max = h[i]
    

print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq

n = int(input())
abs = [tuple(map(int, input().split())) for _ in range(n)]

pq = []

for ab in abs:
  a,b = ab[0],ab[1]
  heapq.heappush(pq, tuple(b,a))
  
dl = 0
tt = 0

ans = "Yes"

for i in range(n):
  ba = pq.pop()
  dl += ba[0]
  tt += ba[1]
  if dl > tt:
    ans = "No"
    break
print(ans)

Fixed submission:
import heapq

n = int(input())
abs = [tuple(map(int, input().split())) for _ in range(n)]

pq = []

for ab in abs:
  a,b = ab[0],ab[1]
  heapq.heappush(pq, tuple([b,a]))
  
dl = 0
tc = 0

ans = "Yes"

for i in range(n):
  ba = heapq.heappop(pq)
  dl = ba[0]
  tc += ba[1]
  if dl < tc:
    ans = "No"
    break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    a = set([int(input()) for _ in range(m)])

    ansls = [0]*(n+1)
    big = 10**9 + 7

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%big
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    a = set([int(input()) for _ in range(m)])

    ansls = [0]*(n+1)
    big = 10**9 + 7

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%big
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n, m = map(int, input().split())
    a = set([int(input()) for _ in range(m)])

    ansls = [0]*(n+1)
    big = 10**9 + 7

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%big
    
    print(ansls[-1])
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())

sk = s[k-1]

for i in range(n):
    if s[i] != sk:
        s[i] = "*"

print(s)

Fixed submission:
n = int(input())
s = input()
k = int(input())

sk = s[k-1]
anslis = [s[i] for i in range(n)]
ans = ""

for i in range(n):
    if s[i] != sk:
        anslis[i] = "*"

for i in range(n):
    ans = ans + str(anslis[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

def nCm(n,m):
    return math.factorial(n) / (math.factorial(m)*(math.facorial(n-m)))

n = int(input())
kinds = 4**n
a = 7 + 10**9
answer = 0
q = 0
r = 0

p = 3 * nCm(n-2, 1)
if n > 6:
    q = 3 * nCm(n-4, 2)
if n > 9:    
    r = nCm(n-6, 3)

answer = (kinds - p + q -r) % a

print(int(answer))

Fixed submission:
a = input()

if a == "A":
    print("T")
elif a == "C":
    print("G")
elif a == "G":
    print("C")
else:
    print("A")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
anstr = ""
for i in range(len(s)):
  anstr += s[i]*(int(s[i])**5000000000000000)
  if len(anstr) > k:
    break
print(anstr[k-1])

Fixed submission:
s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != "1":
    if i <= k-1:
      ans = int(s[i])
      break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
anstr = ""
for i in range(len(s)):
  anstr += s[i]*(int(s[i])**5000000000000000)
print(anstr[k-1])

Fixed submission:
s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != "1":
    if i <= k-1:
      ans = int(s[i])
      break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n,m = map(int, input().split())
qp = [tuple(map(int, input().split())) for _ in range(m)]

qp.sort(key=lambda x:x[1])

ans = 0
pre = 0

while qp:
    a,b = qp.pop(0)
    if pre<a:
        ans += 1
        pre = b-1
print(ans)

Fixed submission:
n,m = map(int, input().split())
qp = [tuple(map(int, input().split())) for _ in range(m)]

qp.sort(key=lambda x:x[1])

ans = 0
pre = 0

while qp:
    a,b = qp.pop(0)
    if pre<a:
        ans += 1
        pre = b-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n,y = map(int, input().split())
    n1000 = y/1000
    n5000 = 0
    n10000 = 0
    a,b,c = -1, -1, -1
    flag = False
    if n <= n1000:
        for bi in range(y//5000+1):
            for ci in range(y//10000+1):
                if n1000-5*bi-10*ci >= 0:
                    if n1000-4*bi-9*ci == n:
                        c = n1000-5*bi-10*ci
                        b = bi
                        a = ci
                        flag = True
                        break
                else:
                    break
            if flag:
                break
    print(int(a),int(b),int(c))
        


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n,y = map(int, input().split())
    aa, ab, ac = -1, -1, -1
    a = y//10000
    b = (y-10000*a)//5000
    c = (y-10000*a-5000*b)//1000
    flag = False
    if n > a+b+c:
        no = n-a-b-c
        for s in range(b+1):
            for t in range(a+1):
                for t1 in range(t+1):
                    for t5 in range(t-t1+1):
                        if s*4 + t1*9 + t5 == no:
                            aa = a-t
                            ab = b-s+t5*2
                            ac = c+s*5+t1*10
                            flag = True
                            break
                    if flag:
                        break
                if flag:
                    break
            if flag:
                break
    elif n == a+b+c:
        aa, ab, ac = a, b, c
    print(aa,ab,ac)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
x,y = map(int, input())

a = x
ans = 1

while a <= y:
    a = a * 2
    ans += 1

print(ans)

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

a = x
ans = 0

while a <= y:
    a = a * 2
    ans += 1

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

input = sys.stdin.readline

ans = 0

n,m = map(int, input().split())
tpl = tuple([tuple(map(int, input().split())) for _ in range(m)])
ls = []
for i in range(1,n+1):
    tmpls = []
    for j in range(1,n+1):
        if i < j:
            if (i,j) in tpl:
                tmpls.append(j)
        elif i > j:
            if (j,i) in tpl:
                tmpls.append(j)
    ls.append(tuple(tmpls))
ls = tuple(ls)

def dfs(a, visitedls, ini, ininext):
    global flag
    visitedls.append(a)
    if a == ini:
        if ininext != visitedls[-2]:
            flag = True
    else:
        for b in ls[a-1]:
            if b not in visitedls:
                dfs(b, visitedls, ini, ininext)
    visitedls.remove(a)

def main():
    for i in range(n):
        for p in ls[i]:
            global flag, ans
            flag = False
            visitedls = []
            dfs(p, visitedls, i+1, p)
            if not flag:
                ans += 1
    print(int(ans/2))



if __name__ == "__main__":
    main()

Fixed submission:
import sys
import numpy as np

input = sys.stdin.readline
n,m = map(int, input().split())
ls = np.zeros([n,n])
for _ in range(m):
    a, b = map(int, input().split())
    if ls[a-1][b-1] == 0:
        ls[a-1][b-1] = 1
        ls[b-1][a-1] = 1

def dfs(a, visitedls):
    visitedls.append(a)
    for b in range(1,n+1):
        if ls[a-1][b-1] == 1 and b not in visitedls:
            dfs(b, visitedls)

def main():
    ans = 0
    for i in range(n):
        for j in range(n):
            if ls[i][j] == 1:
                ls[i][j] = 0
                visitedls = []
                dfs(i+1, visitedls)
                if len(visitedls) != n:
                    ans += 1
                ls[i][j] = 1
    print(int(ans/2))



if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())

ans = 0

for i in range(6,,-1):
  if n >= 2**i:
    ans = 2**i
    break
print(ans)

Fixed submission:
n = int(input())

ans = 1

for i in range(6,0,-1):
  if n >= 2**i:
    ans = 2**i
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a == 1:
  if b == 1:
    print("Draw")
    exit()
  else:
  	print("Alice")
    exit()
else:
  if a == b:
    print("Draw")
    exit()
  elif a > b:
    print("Alice")
    exit()
  else:
    print("Bob")
    exit()

Fixed submission:
a,b = map(int, input().split())
if a == 1:
    if b == 1:
        print("Draw")
    else:
        print("Alice")
else:
    if a == b:
        print("Draw")
    elif b == 1:
        print("Bob")
    elif a > b:
        print("Alice")
    else:
        print("Bob")
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
ls = [tuple(map(int, input().split())) for _ in range(m)]
neighborls = []
for i in range(1,n+1):
    neighbors = []
    for j in range(1, m+1):
        if (i,j) in ls or (j,i) in ls:
            neighbors.append(j)
    neighborls.append(neighbors)

ans = 0

def main():
    global ans
    visitedls = [1]
    ans = dfs(1, visitedls, ans)

    print(ans)
    
        
def dfs(a, visitedls, ans):
    global ans
    if len(visitedls) == n:
        ans += 1
    for i in range(1,n+1):
        if i not in visitedls and i in neighborls[a-1]:
            visitedls.append(i)
            ans = dfs(i, visitedls, ans)
            visitedls.remove(i)
    return ans


if __name__ == "__main__":
    main()

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

ans = 0

def dfs(n, visited):
    global ans
    visited.append(n)
    if len(visited) == N:
        ans += 1
    else:
        for i in l[n-1]:
            if i not in visited:
                dfs(i, visited)
    visited.remove(n)

l = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    l[a-1].append(b)
    l[b-1].append(a) 

dfs(1, [])
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
ls = [tuple(map(int, input().split())) for _ in range(m)]
neighborls = []
for i in range(1,n+1):
    neighbors = []
    for j in range(1, m+1):
        if (i,j) in ls or (j,i) in ls:
            neighbors.append(j)
    neighborls.append(neighbors)

ans = 0

def main():
    visitedls = [1]
    ans = dfs(1, visitedls, ans)

    print(ans)
    
        
def dfs(a, visitedls, ans):
    if len(visitedls) == n:
        ans += 1
        return ans
    for i in range(1,n+1):
        if i not in visitedls and i in neighborls[a-1]:
            visitedls.append(i)
            ans = dfs(i, visitedls, ans)
            visitedls.remove(i)
    return ans


if __name__ == "__main__":
    main()

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

ans = 0

def dfs(n, visited):
    global ans
    visited.append(n)
    if len(visited) == N:
        ans += 1
    else:
        for i in l[n-1]:
            if i not in visited:
                dfs(i, visited)
    visited.remove(n)

l = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    l[a-1].append(b)
    l[b-1].append(a) 

dfs(1, [])
print(ans)
Buggy python submission (verdict: Runtime Error):
a,op,b = input()
if op == "+":
  ans = int(a)+int(b)
else:
  ans = int(a)-int(b)
print(ans)

Fixed submission:
a,op,b = input().split()
ans = 0
if op == "+":
  ans = int(a)+int(b)
else:
  ans = int(a)-int(b)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,op,b = input()
if op == "+":
  ans = a+b
else:
  ans = a-b
print(ans)

Fixed submission:
a,op,b = input().split()
ans = 0
if op == "+":
  ans = int(a)+int(b)
else:
  ans = int(a)-int(b)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input).split()

ans = 3

if a == b:
  if a == c:
    ans = 1
  else:
    ans = 2
elif a == c:
  ans = 2

print(ans)

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

ans = 3

if a == b:
  if a == c:
    ans = 1
  else:
    ans = 2
elif a == c:
  ans = 2
elif b == c:
  ans = 2

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  ans += (i+1)
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(n):
  ans += (i+1)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [map(int, input().split())]

ans = 0
l.sort()

for i in range(n):
    ans += l[2*i]

print(ans)

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

ans = 0
l.sort()

for i in range(n):
    ans += l[2*i]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
ws = input()

rev = 0
for ch in ws:
    if ch == 'R':
        rev += 1
    else:
        rev = 0

return rev

Fixed submission:
ws = input()

if ws.count('S') == 3:
    print(0)
elif ws.count('S') == 2:
    print(1)
elif ws.count('S') == 1:
    if ws.index('S') == 1:
        print(1)
    else:
        print(2)
else:
    print(3)
Buggy python submission (verdict: Runtime Error):
x = int(input())

if 400 <= x and x <= 599:
    return 8
elif 600 <= x and x <= 799:
    return 7
elif 800 <= x and x <= 999:
    return 6
elif 1000 <= x and x <= 1199:
    return 5
elif 1200 <= x and x <= 1399:
    return 4
elif 1400 <= x and x <= 1599:
    return 3
elif 1600 <= x and x <= 1799:
    return 2
else:
    return 1

Fixed submission:
x = int(input())

if 400 <= x and x <= 599:
    print(8)
elif 600 <= x and x <= 799:
    print(7)
elif 800 <= x and x <= 999:
    print(6)
elif 1000 <= x and x <= 1199:
    print(5)
elif 1200 <= x and x <= 1399:
    print(4)
elif 1400 <= x and x <= 1599:
    print(3)
elif 1600 <= x and x <= 1799:
    print(2)
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
l = list(map(int,input().split()))
n, k = l[0], l[1]
a = list(map(int,input().split()))

for i in range(k, n):
    bef, cur = 1, 1
    for ii in range(k):
        bef *= a[i-ii-1]
        cur *= a[i-ii]

    if cur > bef:
        print('Yes')
    else:
        print('No')

Fixed submission:
l = list(map(int,input().split()))
n, k = l[0], l[1]
a = list(map(int,input().split()))

for i in range(k, n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
l = list(map(int,input().split()))
n, k = l[0], l[1]
a = list(map(int,input().split()))

for i in range(k, n):
    bef, cur = 1, 1
    for ii in range(1, k+1):
        bef *= a[i-ii]

    for ii in range(k):
        cur *= a[i-ii]

    if cur > bef:
        print('Yes')
    else:
        print('No')

Fixed submission:
l = list(map(int,input().split()))
n, k = l[0], l[1]
a = list(map(int,input().split()))

for i in range(k, n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

money = 1000
stock = 0

for i in range(N-1):
    if A[i+1] > a[i]:
        if money >= A[i]:
            n = money // A[i]
            stock += n
            money -= A[i] * n
    elif A[i+1] == A[i]:
        continue
    else:
        if stock > 1:
            money += stock * A[i]
            stock = 0

if stock > 0:
    money += stock * A[-1]

print(money)

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

money = 1000
stock = 0

for i in range(N-1):
    if A[i+1] > A[i]:
        if money >= A[i]:
            n = money // A[i]
            stock += n
            money -= A[i] * n
    elif A[i+1] == A[i]:
        continue
    else:
        if stock > 1:
            money += stock * A[i]
            stock = 0

if stock > 0:
    money += stock * A[-1]

print(money)
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())
n = math.gcd(a,b)
count = [1]
while n % 2 == 0:
    count += [2]
    n = n / 2
for i in range(3, int(math.sqrt(n)) + 1, 2):
    while n % i == 0:
        count+=[i]
        n = n / i

if n > 2:
    count+=[n]
c = 1
count = sorted(count)
for i in range(1,len(count)):
    if count[i-1] != count[i]:
        c+=1
print(c)


Fixed submission:
import math
def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
  
a,b = map(int,input().split())
n = gcd(a,b)
count = [1]
while (n % 2 == 0):
    count += [2]
    n = n / 2
for i in range(3, int(math.sqrt(n)) + 1, 2):
    while (n % i == 0):
        count+=[i]
        n = n / i

if n > 2:
    count+=[n]
c = 1
count = sorted(count)
for i in range(1,len(count)):
    if (count[i-1] != count[i]):
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
from collections import deque

n,m = map(int,input().split())

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

for i in range(m):
    a,b=input().split()
    G[int(a)-1]+=[int(b)-1]
    G[int(b)-1]+=[int(a)-1]

#print(G)

dist=[-1 for i in range(n)]
# que=deque([0])
# dist[0]=0

count=0
def bfs(G):
    global count
    #print(que)
    if not que:
        return
    v = que.popleft()

    for nv in G[v]:
        if dist[nv] != -1:
            continue
        dist[nv]=dist[v]+1
        que.append(nv)
    count+=1
    
    bfs(G)

ans=0
for i in range(n):
    count=0
    if dist[i] != -1:
        continue
    else:
        que=deque([i])
        dist[i]=0
        bfs(G)
        if ans < count:
            ans=count

print(ans)


Fixed submission:
from collections import deque
import sys
sys.setrecursionlimit(10 ** 9)


n,m = map(int,input().split())

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

for i in range(m):
    a,b=input().split()
    G[int(a)-1]+=[int(b)-1]
    G[int(b)-1]+=[int(a)-1]

#print(G)

dist=[-1 for i in range(n)]
# que=deque([0])
# dist[0]=0

count=0
def bfs(G):
    global count
    #print(que)
    if not que:
        return
    v = que.popleft()

    for nv in G[v]:
        if dist[nv] != -1:
            continue
        dist[nv]=dist[v]+1
        que.append(nv)
    count+=1
    
    bfs(G)

ans=0
for i in range(n):
    count=0
    if dist[i] != -1:
        continue
    else:
        que=deque([i])
        dist[i]=0
        bfs(G)
        if ans < count:
            ans=count

print(ans)
Buggy python submission (verdict: Runtime Error):
import random

x=int(input())

while True:
    a=random.randint(-1000000000,1000000000)
    b=random.randint(-1000000000,1000000000)
    if x == a*a*a*a*a-b*b*b*b*b:
        print(a,b)
        break

Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
else:
    print("ABC")