Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = list(map(int, input().split()))
if "Y" in s:
    print("Four")
else:
    print("Three")

Fixed submission:
N = int(input())
s = list(input().split())
if "Y" in s:
    print("Four")
else:
    print("Three")

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = list(map(int, input().split())
if "Y" in s:
    print("Four")
else:
    print("Three")

Fixed submission:
N = int(input())
s = list(input().split())
if "Y" in s:
    print("Four")
else:
    print("Three")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split()
if (a + b) % 2 == 0:
           print((a + b) // 2)
else:
           print((a + b) // 2 + 1)

Fixed submission:
a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print((a + b) // 2 + 1)
Buggy python submission (verdict: Time Limit Exceeded):
def lucas(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    return lucas(n - 1) + lucas(n - 2)
    
n = int(input())
print(lucas(n))

Fixed submission:
def lucas(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    return lucas(n - 1) + lucas(n - 2)
    
n = int(input())
lucas = [0 for i in range(87)]
lucas[0] = 2
lucas[1] = 1
for i in range(2, n + 1):
    lucas[i] = lucas[i - 1] + lucas[i - 2]
print(lucas[n])
Buggy python submission (verdict: Runtime Error):
Q, H, S, D = map(int, input().split())
N = int(input())

most_bargain = min(8 * Q, 4 * H, 2 * S, D)
if most_bargain != D:
    print((most_bargain // 2) * N)
else:
    if N % 2 == 0:
        print((N // 2) * D)
    else:
        print((N // 2) * D + min(4 * Q, 2 * H, S))5410760474836152
1524157763907942

Fixed submission:
Q, H, S, D = map(int, input().split())
N = int(input())

most_bargain = min(8 * Q, 4 * H, 2 * S, D)
if most_bargain != D:
    print((most_bargain // 2) * N)
else:
    if N % 2 == 0:
        print((N // 2) * D)
    else:
        print((N // 2) * D + min(4 * Q, 2 * H, S))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
a = ["" for i in range(N)]
for i in range(H):
    a[i] = input()
    
print("#" * (W + 2))
for i in range(H):
    print("#" + a[i] + "#")
print("#" * (W + 2))

Fixed submission:
H, W = map(int, input().split())
a = ["" for i in range(H)]
for i in range(H):
    a[i] = input()
    
print("#" * (W + 2))
for i in range(H):
    print("#" + a[i] + "#")
print("#" * (W + 2))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
  
 if A <= C and C <= B:
    print("Yes")
else:
    print("No")

Fixed submission:
A, B, C = map(int, input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()
print(s1[0].upper() + S2[0].upper() + S3[0].upper())

Fixed submission:
s1, s2, s3 = input().split()
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if abs(A - b) <= 1:
    print("Brown")
else:
    print("Alice")

Fixed submission:
A, B = map(int, input().split())
if abs(A - B) <= 1:
    print("Brown")
else:
    print("Alice")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

a = [0 for i in range(N)]
b = [0 for i in range(N)]
c = [0 for i in range(N)]
d = [0 for i in range(N)]

for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())
    
for i in range(N):
    closest_ind = -1
    closest_dist = 10000000000
    for j in range(M):
        if closest_dist > abs(a[i] - c[j]) + abs(b[i] - d[j]):
            closest_ind = j
            closest_dist = abs(a[i] - c[j]) + abs(b[i] - d[j])
    print(closest_ind + 1)

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

a = [0 for i in range(N)]
b = [0 for i in range(N)]
c = [0 for i in range(M)]
d = [0 for i in range(M)]

for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())
    
for i in range(N):
    closest_ind = -1
    closest_dist = 10000000000
    for j in range(M):
        if closest_dist > abs(a[i] - c[j]) + abs(b[i] - d[j]):
            closest_ind = j
            closest_dist = abs(a[i] - c[j]) + abs(b[i] - d[j])
    print(closest_ind + 1)
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
print(max(A*B), max(C* D))

Fixed submission:
A, B, C, D = map(int, input().split())
print(max(A*B, C* D))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if 2 * i not in counts or counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if 2 * i not in counts or counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2))
else:
    print(0)

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

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if 2 * i not in counts or counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if 2 * i - 1 not in counts or counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2) % 1000000007)
else:
    print(0)

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

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2))
else:
    print(0)

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

def is_valid(A):
    counts = {}
    for a in A:
        if a in counts:
            counts[a] += 1
        else:
            counts[a] = 1
    if len(A) % 2 == 1:
        if counts[0] != 1:
            return False
        
        for i in range(1, len(A) // 2 + 1):
            if 2 * i not in counts or counts[2 * i] != 2:
                return False
        return True
    else:
        for i in range(1, len(A) // 2 + 1):
            if 2 * i - 1 not in counts or counts[2 * i - 1] != 2:
                return False
        return True
    return True
        
if is_valid(A):
    print(2 ** (N // 2) % 1000000007)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
S = ["" for i in range(3)]
abc = "ABC"
for i in range(3):
    S[i] = input()
    


turn = 0
zero_card = False
while True:
    if len(S[turn]) == 1 and zero_card:
        print(abc[turn])
        break
    else:
        if len(S[turn]) == 1:
            zero_card = True
        next_turn = 0
        if S[turn][0] == "a":
            next_turn = 0
        elif S[turn][0] == "b":
            next_turn = 1
        else:
            next_turn = 2
        S[turn] = S[turn][1:]
        turn = next_turn

Fixed submission:
S = ["" for i in range(3)]
abc = "ABC"
for i in range(3):
    S[i] = input()
    


turn = 0
zero_card = False
while True:
    if len(S[turn]) == 0:
        print(abc[turn])
        break
    else:
        next_turn = 0
        if S[turn][0] == "a":
            next_turn = 0
        elif S[turn][0] == "b":
            next_turn = 1
        else:
            next_turn = 2
        S[turn] = S[turn][1:]
        turn = next_turn
Buggy python submission (verdict: Time Limit Exceeded):
n,x,m = map(int,input().split())
ans = 0
l = [x]

for i in range(n):
	x = (x*x)%m
	if x in l:
		break
	l.append(x)

if x == 0:
	print(sum(l))
else:
	p = l[0]
	k = 1
	Su = 0
	while p != x and k < len(l):
		Su += p
		p = l[k]
		k += 1
	l = l[k-1:]

	Su2 = 0
	for r in range((n-k)%len(l) + 1):
		Su2 += l[r]
	print(Su + ((n-k)//len(l))*sum(l) + Su2)

Fixed submission:
n,x,m = map(int,input().split())
ans = 0
l = [x]
s = [0]*m
s[0] = 1

for i in range(n):
	x = (x*x)%m
	if s[x] == 1:
		break
	s[x] = 1
	l.append(x)

if x == 0:
	print(sum(l))
else:
	p = l[0]
	k = 1
	Su = 0
	while p != x and k < len(l):
		Su += p
		p = l[k]
		k += 1
	l = l[k-1:]

	Su2 = 0
	for r in range((n-k)%len(l) + 1):
		Su2 += l[r]
	print(Su + ((n-k)//len(l))*sum(l) + Su2)
Buggy python submission (verdict: Runtime Error):
s = int(input())
p = [1]*(s+1)
mod = 10**9 + 7

p[1] = 0
p[2] = 0
if s >= 3:
	for i in range(3,s+1):
		p[i] = (sum(p[:i-2]))%mod
print(p[s])

Fixed submission:
s = int(input())
p = [0]*(s+1)
mod = 10**9 + 7
p[0] = 1

if s >= 3:
	for i in range(3,s+1):
		p[i] = (sum(p[:i-2]))%mod
print(p[s])

Buggy python submission (verdict: Runtime Error):
s = int(input())
p = [1]*(s+1)
mod = 10**9 + 7

p[1] = 0
p[2] = 0
if s >= 3
	for i in range(3,s+1):
		p[i] = (sum(p[:i-2]))%mod
print(p[s])

Fixed submission:
s = int(input())
p = [0]*(s+1)
mod = 10**9 + 7
p[0] = 1

if s >= 3:
	for i in range(3,s+1):
		p[i] = (sum(p[:i-2]))%mod
print(p[s])

Buggy python submission (verdict: Runtime Error):
s = int(input())
p = [1]*(s+1)
mod = 10**9 + 7

p[1] = 0
p[2] = 0

for i in range(3,s+1):
	p[i] = (sum(p[:i-2]))%mod
print(p[s])

Fixed submission:
s = int(input())
p = [0]*(s+1)
mod = 10**9 + 7
p[0] = 1

if s >= 3:
	for i in range(3,s+1):
		p[i] = (sum(p[:i-2]))%mod
print(p[s])
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
 
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1] * n

	def find(self, x):
		if self.parents[x] < 0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]
	def union(self, x, y):
		x = self.find(x)
		y = self.find(y)
		if x == y:
			return
		if self.parents[x] > self.parents[y]:
			x, y = y, x
		self.parents[x] += self.parents[y]
		self.parents[y] = x

	def size(self, x):
		return -self.parents[self.find(x)]

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def members(self, x):
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i) == root]
	def roots(self):
		return [i for i, x in enumerate(self.parents) if x < 0]
	def group_count(self):
		return len(self.roots())
	def all_group_members(self):
		ret = defaultdict(list)
		for i in range(self.n):
			ret[self.find(i)].append(i)
		return ret

	def __str__(self):
		return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m = map(int, input().split())
 
uf = UnionFind(1000)

for _ in range(m):
	a,b = map(int, input().split())
	uf.union(a, b)
MA = 0
for i in range(1000):
	if MA <= uf.size(i):
		MA = uf.size(i)
print(MA)

Fixed submission:
from collections import defaultdict
 
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1] * n

	def find(self, x):
		if self.parents[x] < 0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]
	def union(self, x, y):
		x = self.find(x)
		y = self.find(y)
		if x == y:
			return
		if self.parents[x] > self.parents[y]:
			x, y = y, x
		self.parents[x] += self.parents[y]
		self.parents[y] = x

	def size(self, x):
		return -self.parents[self.find(x)]

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def members(self, x):
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i) == root]
	def roots(self):
		return [i for i, x in enumerate(self.parents) if x < 0]
	def group_count(self):
		return len(self.roots())
	def all_group_members(self):
		ret = defaultdict(list)
		for i in range(self.n):
			ret[self.find(i)].append(i)
		return ret

	def __str__(self):
		return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m = map(int, input().split())
 
uf = UnionFind(n+1)

for _ in range(m):
	a,b = map(int, input().split())
	uf.union(a, b)
MA = 0
for i in range(n+1):
	if MA <= uf.size(i):
		MA = uf.size(i)
print(MA)
Buggy python submission (verdict: Runtime Error):
k = int(input())
c = 0
a = [0]*(k+1)
a[0] = 7%k

if k%2 == 0 or k%5 == 0:
	print('-1')
else:
	for i in range(1,k+1):
		c += 1 
		a[i+1] = (10*a[i] + 7)%k
		if a[i+1] == 0:
			break
	print(c)

Fixed submission:
k = int(input())
c = 0
t = 7%k
a = [t]*(k+1)

if k%2 == 0 or k%5 == 0:
	print('-1')
elif 7%k == 0:
	print('1')
else:
	for i in range(1,k):
		c += 1
		a[i+1] = (10*a[i] + 7)%k
		if a[i+1] == 0:
			break
	print(c + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
 
ans = [0]*(n+1)
for i in range(1,n+1):
	for x in range(1,100):
		for y in range(1,100):
			if pow(x+y,2) - 4*(pow(x,2) + x*y +pow(y,2) - i) >= 0:
				p = (1/2)*(-(x+y) + math.sqrt(pow(x+y,2) - 4*(pow(x,2) +x*y +pow(y,2) - i)))
				q = (1/2)*(-(x+y) - math.sqrt(pow(x+y,2) - 4*(pow(x,2) +x*y +pow(y,2) - i)))
				if (p%1 == 0 and p >= 1) or (q%1 == 0 and q >= 1):
					ans[i] += 1
for i in range(1,n+1):
	print(ans[i])

Fixed submission:
n = int(input())

ans = [0]*(n+1)

for x in range(1,100):
	for y in range(1,100):
		for z in range(1,100):
			if pow(x,2) + pow(y,2) + pow(z,2) + x*y + y*z + z*x <= n:
				ans[pow(x,2) + pow(y,2) + pow(z,2) + x*y + y*z + z*x] += 1			
for i in range(1,n+1):
	print(ans[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
	b[i],c[i] = map(int,input().split())

s = 0
L = [0]*(10**5)
for A in a:
	L[A] += 1
	s += A

for i in range(q):
	s += L[b[i]]*(c[i]-b[i])
	L[c[i]] += L[b[i]]
	L[b[i]] = 0
	print(s)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
	b[i],c[i] = map(int,input().split())

s = 0
L = [0]*(10**5+1)
for A in a:
	L[A] += 1
	s += A

for i in range(q):
	s += L[b[i]]*(c[i]-b[i])
	L[c[i]] += L[b[i]]
	L[b[i]] = 0
	print(s)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))


Fixed submission:
n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
print(len(set(range(1,n+1))-l))

Fixed submission:
n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set(range(1,n+1))
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	if set(A[i]) == l:
		l = set()
		break
	l = l - set(A[i])
print(len(l))

Fixed submission:
n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set(range(1,n+1))
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l - set(A[i])
print(len(l))

Fixed submission:
n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))
Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,n = map(int,input().split())
max = 0
x = 0
while math.floor(a*x/b) - a*math.floor(x/b) <= a and x <= n:
	if max < math.floor(a*x/b) - a*math.floor(x/b):
		max = math.floor(a*x/b) - a*math.floor(x/b)
	x += 1
print(max)

Fixed submission:
import math
a,b,n = map(int,input().split())
if n >= b-1:
	print(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b))
else:
	print(math.floor(a*n/b) - a*math.floor(n/b))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))

if N-sum(a) >= 0:
	print(N-sum(a))
else:
	print('-1')

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
 
if n-sum(a) >= 0:
	print(n-sum(a))
else:
	print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
s = [0]*n

for i in range(max(a)):
	s[i] = a.count(i+1)
	
for i in range(n):
  	print(s[i])

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

c = [0]*n
for i in a:
	c[i-1] += 1

for i in range(n):
	print(c[i])

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

for i in range(n):
	s[i] = a.count(i+1)

for i in range(n):
  	print(s[i])

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

c = [0]*n
for i in a:
	c[i-1] += 1

for i in range(n):
	print(c[i])

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

for i in range(n):
	s[i+1] = a.count(i+1)

for i in range(n):
  	print(s[i+1])

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

c = [0]*n
for i in a:
	c[i-1] += 1

for i in range(n):
	print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
s = [0]*n
c = [0]*n
A = [0]*n
k = 0

for i in range(n):
	s[i] = input()

s.sort()    
    
for i in range(n): 
	c[i] = s.count(s[i])

M = max(c)

for i in range(n):
	if c[k] == M:
		print(s[k])
		k += M-1
	k += 1
	if k >= n:
		break

Fixed submission:
n = int(input())
s = [0]*n
c = [1]*n
A = [0]*n
k = 0

for i in range(n):
	s[i] = input()

s.sort()    
    
for i in range(n-1): 
	if s[i] == s[i+1]:
		c[i+1] += c[i]
      
M = max(c)

for i in range(n):
	if c[i] == M:
		print(s[i])
Buggy python submission (verdict: Runtime Error):
k=int(input())
x=int(input())
 
if 500*k >= x:
print("'Yes'")
else:
print("'No'")

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

if 500*k >= x:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k = int(input())
x = int(input())
 
if 500*k < x:
print("No")
else:
print("Yes")

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

if 500*k >= x:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
k=int(input())
x=int(input())

if 500*k < x:
print("No")
else
print("Yes")


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

if 500*k >= x:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i] == A and s[i+1] == B and s[i+2] == C:
		k += 1
        
print(k)


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

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i]=A and s[i+1]=B and s[i+2]=C:
		k += 1
        
print(k)


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

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

k = 0

for i in i <= n-3:
	if s[i]=A and s[i+1]=B and s[i+2]=C:
		k += 1
        
print(k)

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

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

print(s+t)

Fixed submission:
s,t = input().split()
 
print(t+s)
Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)
else:
	print(0)

Fixed submission:
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 != 0 or (2*y-x)% 3 != 0 or ((2 * y - x) / 3 < 0) or ((2 * x - y) / 3 < 0):
	print(0)
else:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)

Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = (2*y-x)/3
	m = (2*x-y)/3
	p = m/n
	print(int(pow(1+p,n)*pow(1+1/p,m)*math.sqrt((n+m)/(n*m))/math.sqrt(2*math.pi))%(pow(10,9)+7))
#	print(int(math.factorial(n+m)/(math.factorial(n)*math.factorial(m)))%(pow(10,9)+7))
else:
	print(0)

Fixed submission:
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 != 0 or (2*y-x)% 3 != 0 or ((2 * y - x) / 3 < 0) or ((2 * x - y) / 3 < 0):
	print(0)
else:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)

Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = (2*y-x)/3
	m = (2*x-y)/3
	print(int(math.factorial(n+m)/(math.factorial(n)*math.factorial(m)))%(pow(10,9)+7))
else:
	print(0)

Fixed submission:
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 != 0 or (2*y-x)% 3 != 0 or ((2 * y - x) / 3 < 0) or ((2 * x - y) / 3 < 0):
	print(0)
else:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)