Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
X = int(input())
l = []
for i in range(2, int(X ** 0.5) + 1):
  j = 2
  while i ** j <= X:
    j += 1
  l.append(i ** j)
l.sort()
print(l[-1])


Fixed submission:
X = int(input())
l = []
if X < 4:
  print(1)
else:
  for i in range(2, int(X ** 0.5) + 1):
    j = 2
    while i ** j <= X:
      l.append(i ** j)
      j += 1
  l.sort()
  print(l[-1])

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
l = []
for i in range(1, int(X ** 0.5) + 1):
  j = 2
  while i ** j <= X:
    j += 1
  l.append(i ** j)
l.sort()
print(l[-1])


Fixed submission:
X = int(input())
l = []
if X < 4:
  print(1)
else:
  for i in range(2, int(X ** 0.5) + 1):
    j = 2
    while i ** j <= X:
      l.append(i ** j)
      j += 1
  l.sort()
  print(l[-1])

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
l = []
for i in range(int(X ** 0.5) + 1):
  j = 2
  while i ** j <= X:
    l.append(i ** j)
    j += 1
l.sort()
print(l[-1])

Fixed submission:
X = int(input())
l = []
if X < 4:
  print(1)
else:
  for i in range(2, int(X ** 0.5) + 1):
    j = 2
    while i ** j <= X:
      l.append(i ** j)
      j += 1
  l.sort()
  print(l[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
dic = {}
dic[0] = 1
total = 0
for i in range(n):
  total += a[i]
  dic[total] += 1
ans = 0
for v in dic.values():
  ans += v*(v-1) // 2
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
dic = {}
dic[0] = 1
total = 0
for i in range(n):
  total += a[i]
  if total in dic:
    dic[total] += 1
  else:
    dic[total] = 1
ans = 0
for v in dic.values():
  ans += v*(v-1) // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
def com(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
l = list(map(int, input().split()))
l.sort()
n = l.pop()
ans = 0
M = 0
for r in l:
  if com(n, r) > M:
    M = com(n, r)
    ans = r
print(n, ans)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
m = l.pop()
a = m
ans = 0
for r in l:
  if abs((m / 2) - r) < a:
    a = abs((m / 2) - r)
    ans = r
print(m, ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = {}
for i in range(N):
  a = input()
  if a in s:
    s[a] += 1
  else:
    s[a] = 1
M = int(input())
t = {}
for i in range(M):
  b = input()
  if b in t:
    t[b] += 1
  else:
    t[b] = 1
ans = 0
for p in s:
  if p in t:
    m = s[p] - t[p]
  else:
    m = s[p]
  if m > n:
    ans = m
print(ans)
  

Fixed submission:
N = int(input())
s = {}
for i in range(N):
  a = input()
  if a in s:
    s[a] += 1
  else:
    s[a] = 1
M = int(input())
t = {}
for i in range(M):
  b = input()
  if b in t:
    t[b] += 1
  else:
    t[b] = 1
ans = 0
for p in s:
  if p in t:
    m = s[p] - t[p]
  else:
    m = s[p]
  if m > ans:
    ans = m
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(1, N + 1):
  if i % 2 == 1:
    s += a[-i]
  else:
    s -= a[-i]
print(s)


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(1, N + 1):
  if i % 2 == 1:
    s += a[-i]
  else:
    s -= a[-i]
print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(N):
  if i % 2 == 1:
    s += a[-i]
  else:
    s -= a[-i]
print(s)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(1, N + 1):
  if i % 2 == 1:
    s += a[-i]
  else:
    s -= a[-i]
print(s)
Buggy python submission (verdict: Runtime Error):
x, y = int(input())
if x % y == 0:
  print(-1)
else:
  print(x)

Fixed submission:
x, y = map(int, input().split())
if x % y == 0:
  print(-1)
else:
  print(x)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
dic = {'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15}
if dic[X] > dic[Y]:
  print('>')
elif dic[X] == dic[Y]:
  print('=')
else:
  print('<')
  

Fixed submission:
X, Y = input().split()
dic = {'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15}
if dic[X] > dic[Y]:
  print('>')
elif dic[X] == dic[Y]:
  print('=')
else:
  print('<')
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
s = []
e = []
for i in range(M):
  a, b = map(int, input().split())
  if a == 1:
    s.append(b)
  if b == N:
    e.append(a)
ans = 'IMPOSSIBLE'
for k in s:
  if k in e:
    ans = 'POSSIBLE'
    break
print(ans)

Fixed submission:
N, M = map(int, input().split())
s = []
e = []
for i in range(M):
  a, b = map(int, input().split())
  if a == 1:
    s.append(b)
  if b == N:
    e.append(a)
if set(s) & set(e):
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dic = {}
for i in range(N):
  a = int(input())
  dic[i + 1] = a
l = [1]
n = dic[1]
i = 1
flg = False
if n == 2:
  print(1)
else:
  while n not in l:
    l.append(n)
    n = dic[n]
    i += 1
    if n == 2:
      flg = True
      ans = i
      break
  if flg:
    print(ans)
  else:
    print(-1)
  


Fixed submission:
n = int(input())
dic = {}
push = [True] * n
for i in range(1, n+1):
  a = int(input())
  dic[i] = a
i = 1
cnt = 1
push[0] = False
while True:
  if dic[i] == 2:
    break
  else:
    k = dic[i]
    if push[k-1]:
      i = k
      cnt += 1
      push[k-1] = False
    else:
      cnt = -1
      break
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dic = {}
for i in range(N):
  a = int(input())
  dic[i + 1] = a
l = [1]
n = dic[1]
i = 1
flg = False
if n == 2:
  print(1)
else:
  while n not in l:
    l.append(n)
    n = dic[n]
    i += 1
    if n == 2:
      flg = True
      ans = i
      break
  if flg:
    print(ans)
  else:
    print(-1)
  

Fixed submission:
n = int(input())
dic = {}
push = [True] * n
for i in range(1, n+1):
  a = int(input())
  dic[i] = a
i = 1
cnt = 1
push[0] = False
while True:
  if dic[i] == 2:
    break
  else:
    k = dic[i]
    if push[k-1]:
      i = k
      cnt += 1
      push[k-1] = False
    else:
      cnt = -1
      break
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input()))
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, M = map(int, input().split())
dic = {}
for i in range(M):
  a, b = map(int, input().split())
  if a in dic:
    dic[a] += 1
  else:
    dic[a] = 1
  if b in dic:
    dic[b] += 1
  else:
    dic[b] = 1
for i in range(1, N + 1):
  print(dic[i])

Fixed submission:
N, M = map(int, input().split())
dic = {}
for i in range(M):
  a, b = map(int, input().split())
  if a in dic:
    dic[a] += 1
  else:
    dic[a] = 1
  if b in dic:
    dic[b] += 1
  else:
    dic[b] = 1
for i in range(1, N + 1):
  if i not in dic:
    print(0)
  else:
    print(dic[i])
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
  print('YES')
else:
  print('NO')

Fixed submission:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
list_1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
dic = {}
for al in list_1:
  dic[al] = 100
for i in range(n):
  s = input()
  for al in list_1:
    count
    for t in s:
      if al == t:
        count += 1
    if dic[al] > count:
      dic[al] = count
ans = ''
for al in list_1:
  if dic[al] > 0:
    for i in range(dic[al]):
      ans += al
print(ans)

Fixed submission:
n = int(input())
list_1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
dic = {}
for al in list_1:
  dic[al] = 100
for i in range(n):
  s = input()
  for al in list_1:
    count = 0
    for t in s:
      if al == t:
        count += 1
    if dic[al] > count:
      dic[al] = count
ans = ''
for al in list_1:
  if dic[al] > 0:
    for i in range(dic[al]):
      ans += al
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
list_A = []
list_Z = []
for i in range(len(S)):
  if s[i] == 'A':
    list_A.append(i)
  if s[i] == 'Z':
    list_Z.append(i)
a = list_A[0]
z = list_Z[-1]
print(z - a + 1)

Fixed submission:
S = input()
list_A = []
list_Z = []
for i in range(len(S)):
  if S[i] == 'A':
    list_A.append(i)
  if S[i] == 'Z':
    list_Z.append(i)
a = list_A[0]
z = list_Z[-1]
print(z - a + 1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
r = []
for _ in range(n):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)
before_sa = 0
for i in range(1, n+1):
  j = 0
  a, b = l[-i], r[-i]
  while True:
    if j == 0 and a % b == 0:
      sa = 0
    elif j == 0 and a % b != 0:
      sa = (a//b + 1) * b - a
    elif j > 0:
      sa = (a//b + j) * b - a
    if before_sa <= sa:
      before_sa = sa
      break
    j += 1
print(before_sa)


Fixed submission:
n = int(input())
l = []
r = []
for _ in range(n):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)
before_sa = 0
for i in range(1, n+1):
  a, b = l[-i], r[-i]
  a += before_sa
  if a % b == 0:
    continue
  else:
    sa = (a//b + 1) * b - a
    before_sa += sa
print(before_sa)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
r = []
for _ in range(n):
  a, b = map(int, input())
  l.append(a)
  r.append(b)
before_sa = 0
for i in range(1, n+1):
  j = 0
  a, b = l[-i], r[-i]
  while True:
    if j == 0 and a % b == 0:
      sa = 0
    elif j == 0 and a % b != 0:
      sa = (a//b + 1) * b - a
    elif j > 0:
      sa = (a//b + j) * b - a
    if before_sa <= sa:
      before_sa = sa
      break
    j += 1
print(before_sa)

Fixed submission:
n = int(input())
l = []
r = []
for _ in range(n):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)
before_sa = 0
for i in range(1, n+1):
  a, b = l[-i], r[-i]
  a += before_sa
  if a % b == 0:
    continue
  else:
    sa = (a//b + 1) * b - a
    before_sa += sa
print(before_sa)
Buggy python submission (verdict: Runtime Error):
def prime(p):
  if p == 2:
    return True
  else:
    flg = False
    count = 0
    for i in range(1, int(p ** 0.5)):
      if p % i == 0:
        count += 1
    if count == 1:
      flg = True
    return flg
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prime(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  for r in l:
    ans *= r % (10 ** 9 + 7)
  print(ans)


Fixed submission:
def prim(p):
  if p == 2:
    return True
  else:
    flg = False
    count = 0
    for i in range(1, int(p ** 0.5) + 1):
      if p % i == 0:
        count += 1
    if count == 1:
      flg = True
    return flg
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prim(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  ans = 1
  for r in l:
    ans *= r
    ans = ans % (10 ** 9 + 7)
  print(ans)

Buggy python submission (verdict: Runtime Error):
def prime(p):
  if p == 2:
    return True
  else:
    count = 0
    for i in range(1, int(p ** 0.5), 2):
      if p % i == 0:
        count += 1
    if count == 1:
      return True
    else:
      return False
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prime(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  for r in l:
    ans *= r % (10 ** 9 + 7)
  print(ans)

Fixed submission:
def prim(p):
  if p == 2:
    return True
  else:
    flg = False
    count = 0
    for i in range(1, int(p ** 0.5) + 1):
      if p % i == 0:
        count += 1
    if count == 1:
      flg = True
    return flg
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prim(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  ans = 1
  for r in l:
    ans *= r
    ans = ans % (10 ** 9 + 7)
  print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
for i in range(N):
  c = input()
  print(c)
  print(c)


Fixed submission:
H, W = map(int, input().split())
for i in range(H):
  c = input()
  print(c)
  print(c)

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input())
for i in range(N):
  c = input()
  print(c)
  print(c)

Fixed submission:
H, W = map(int, input().split())
for i in range(H):
  c = input()
  print(c)
  print(c)
Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = list(map(int, input().split()))
s = 0
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)


Fixed submission:
N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)

Fixed submission:
N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
alpha = {1:'A', 2:'B', 3:'C', 4:'D', 5:'E', 6:'F', 7:'G', 8:'H', 9:'I', 10:'J', 11:'K', 12:'L', 13:'M', 14:'N', 15:'O', 16:'P', 17:'Q', 18:'R', 19:'S', 20:'T', 21:'U', 22:'V', 23:'W', 24:'X', 25:'Y', 26:'Z'}
h, w = map(int, input().split())
for i in range(h):
  a = list(map(int, input().split()))
  for j in range(w):
    if a[j] == 'snuke':
      ans = alpha[j+1] + str(i+1)
      break
print(ans)

Fixed submission:
alpha = {1:'A', 2:'B', 3:'C', 4:'D', 5:'E', 6:'F', 7:'G', 8:'H', 9:'I', 10:'J', 11:'K', 12:'L', 13:'M', 14:'N', 15:'O', 16:'P', 17:'Q', 18:'R', 19:'S', 20:'T', 21:'U', 22:'V', 23:'W', 24:'X', 25:'Y', 26:'Z'}
h, w = map(int, input().split())
for i in range(h):
  a = list(input().split())
  for j in range(w):
    if a[j] == 'snuke':
      ans = alpha[j+1] + str(i+1)
      break
print(ans)
Buggy python submission (verdict: Runtime Error):
A = map(int, input().split())
A.sort()
if A[2] == A[1] + A[0]:
  print('Yes')
else:
  print('No')


Fixed submission:
A = list(map(int, input().split()))
A.sort()
if A[2] == A[1] + A[0]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
A.sort()
if A[2] = A[1] + A[0]:
  print('Yes')
else:
  print('No')


Fixed submission:
A = list(map(int, input().split()))
A.sort()
if A[2] == A[1] + A[0]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
t = input()
for i in range(n):
  cnt = 0
  for j in range(i, n):
    if s[j] != t[j-i]:
      break
    cnt += 1
  if cnt == n-i:
    ans = n+i
    break
print(ans)

Fixed submission:
n = int(input())
s = input()
t = input()
for i in range(n):
  cnt = 0
  for j in range(i, n):
    if s[j] != t[j-i]:
      break
    cnt += 1
  if cnt == n-i:
    ans = n+i
    break
if cnt == 0:
  ans = 2*n
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
t = input()
for i in range(n):
  if s[i:] == t[:n-i]:
    ans = n + i
    break
print(ans)

Fixed submission:
n = int(input())
s = input()
t = input()
for i in range(n):
  cnt = 0
  for j in range(i, n):
    if s[j] != t[j-i]:
      break
    cnt += 1
  if cnt == n-i:
    ans = n+i
    break
if cnt == 0:
  ans = 2*n
print(ans)
Buggy python submission (verdict: Runtime Error):
k, t = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
double_cnt = 0
total = 0
for i in range(t):
  b = a[i] - bouble_cnt
  c = total - (bouble_cnt + 1) + 2
  bouble_cnt = max(0, b-c)
  total += a[i]
print(bouble_cnt)

Fixed submission:
k, t = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
double_cnt = 0
total = 0
for i in range(t):
  b = a[i] - double_cnt
  c = total - (double_cnt + 1) + 2
  double_cnt = max(0, b-c)
  total += a[i]
print(double_cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
t_max = max(t)
for i in range(n):
  if a[i] == t_max:
    max_ind = i
    break
if t[max_ind] != a[max_ind] or t[-1] != a[0]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx .append(i)
    before = t[i]
  if len(idx) == 0:
    print(1)
  else:
    new_idx = []
    for j in idx:
      if j < n-1 and a[j] == a[j+1]:
        new_idx.append(j)
    if len(new_idx) == 0:
      print(0)
    else:
      ans = 1
      for k in new_idx:
        ans *= min(t[k], a[k])
        ans %= MOD
      print(ans)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
t_max = max(t)
for i in range(n):
  if t[i] == t_max:
    max_ind = i
    break
if t[max_ind] != a[max_ind] or t[-1] != a[0]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx .append(i)
    before = t[i]
  if len(idx) == 0:
    print(1)
  else:
    new_idx = []
    for j in idx:
      if j < n-1 and a[j] == a[j+1]:
        new_idx.append(j)
    if len(new_idx) == 0:
      print(1)
    else:
      ans = 1
      for k in new_idx:
        ans *= min(t[k], a[k])
        ans %= MOD
      print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
if t[0] != a[-1]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx.append(i)
    before = t[i]
  new_index = []
  for j in idx:
    if j < n-1:
      if a[j] == a[j+1]:
        new_index.append(j)
  if len(new_index) > 0:
    print(1)
  else:
    ans = 1
    for k in new_index:
      ans *= min(t[k], a[k])
      ans %= MOD
  print(ans)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
t_max = max(t)
for i in range(n):
  if t[i] == t_max:
    max_ind = i
    break
if t[max_ind] != a[max_ind] or t[-1] != a[0]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx .append(i)
    before = t[i]
  if len(idx) == 0:
    print(1)
  else:
    new_idx = []
    for j in idx:
      if j < n-1 and a[j] == a[j+1]:
        new_idx.append(j)
    if len(new_idx) == 0:
      print(1)
    else:
      ans = 1
      for k in new_idx:
        ans *= min(t[k], a[k])
        ans %= MOD
      print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    l.pop()
for r in l:
  print(r, end='')

Fixed submission:
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')

Buggy python submission (verdict: Runtime Error):
s = input()
c = ''
for t in s:
  if t == '0' or t == '1':
    c += t
  if t == 'B' and c != '':
    c -= c[-1]
print(c)


Fixed submission:
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')

Buggy python submission (verdict: Runtime Error):
s = input()
c = ''
for t in s:
  if t == '0' or t == '1':
    c += t
  elif t == 'B':
    if c != '':
      k = c[-1]
      c -= k
print(c)


Fixed submission:
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')

Buggy python submission (verdict: Runtime Error):
s = input()
c = ''
for t in s:
  if t == '0' or t == '1':
    c += t
  elif t == 'B':
    if c != '':
      c = c - c[-1]
print(c)

Fixed submission:
s = input()
l = []
for t in s:
  if t == '0' or t == '1':
    l.append(t)
  elif t == 'B':
    if l != []:
      l.pop()
for r in l:
  print(r, end='')
Buggy python submission (verdict: Runtime Error):
N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append((v-1, w))
    e[v-1].append((u-1, w))
l = [-1 for i in range(N)]
def dfs(u, p, col):
    l[u] = col
    for v, w in e[u]:
        if v == p:
            continue
        if w % 2 == 0:
            dfs(v, u, col)
        else:
            dfs(v, u, 1-col)
    
dfs(0, -1, 0)
for col in l:
    print(col)


Fixed submission:
from collections import deque

N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append((v-1, w))
    e[v-1].append((u-1, w))
l = [-1 for i in range(N)]

q = deque()
l[0] = 0
q.append(0)
while (q):
    u = q.pop()
    for v, w in e[u]:
        if l[v] >= 0:
            continue
        if w % 2 == 0:
            l[v] = l[u]
        else:
            l[v] = 1 - l[u]
        q.append(v)

for col in l:
    print(col)

Buggy python submission (verdict: Runtime Error):
N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append(v-1)
    e[v-1].append(u-1)
l = [-1 for i in range(N)]
def dfs(u, p, col):
    l[u] = col
    for v in e[u]:
        if v != p:
            dfs(v, u, 1 - col)
    
dfs(0, -1, 0)
for col in l:
    print(col)


Fixed submission:
from collections import deque

N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append((v-1, w))
    e[v-1].append((u-1, w))
l = [-1 for i in range(N)]

q = deque()
l[0] = 0
q.append(0)
while (q):
    u = q.pop()
    for v, w in e[u]:
        if l[v] >= 0:
            continue
        if w % 2 == 0:
            l[v] = l[u]
        else:
            l[v] = 1 - l[u]
        q.append(v)

for col in l:
    print(col)
Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv
a = args[1]
b = args[2]
c = args[3]
d = args[4]

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

print(max(li))

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

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

print(max(li))

Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv
a = args[1]
b = args[2]
c = args[3]
d = args[4]

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

print(max(li))

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

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

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

N/x=math.ceil(a)
a*T=aa

print(aa)

Fixed submission:
n,x,t = input().split()

b = -(-int(n)//int(x))
a = b*int(t)

print(a)