Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_lst = list(map(int, input().split()))
index_lst = [0]*(a_max + 1)

for ai in a_lst:
    for multi in range(ai, a_max+1, ai):
        index_lst[multi] += 1

ans = 0
for ai in a_lst:
    if index_lst[ai] == 1:
        ans += 1
print(ans)

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

a_max = max(a_lst)
index_lst = [0]*(a_max + 1)

for ai in a_lst:
    for multi in range(ai, a_max+1, ai):
        index_lst[multi] += 1

ans = 0
for ai in a_lst:
    if index_lst[ai] == 1:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_lst = list(map(int, input().split()))

c = 0

for i in a_lst:
    if i == 0:
        print(0)
        c = 1
        break
        
    if i > 1000000000000000000:
        print('-1')
        c = 1
        break
        
if c != 1:
    for i, alst in enumerate(a_lst):
        if i == 0:
            b = alst
        else:
            b = b * alst
    
    if b > 1000000000000000000:
        print('-1')
    else:
        print(b)

Fixed submission:
N = int(input())
A= list(map(int, input().split()))
result=1
if 0 in A:
    result = 0
else:
    for t in range(N):
        result *= A[t]
        if result > 10 ** 18:
            result = -1
            break
print(result)

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

c = 0

for i in a_lst:
    if i == 0:
        print(0)
        c = 1
        break
if c != 1:
    for i, alst in enumerate(a_lst):
        if i == 0:
            b = alst
        else:
            b = b * alst
    
    if b > 1000000000000000000:
        print('-1')
    else:
        print(b)

Fixed submission:
N = int(input())
A= list(map(int, input().split()))
result=1
if 0 in A:
    result = 0
else:
    for t in range(N):
        result *= A[t]
        if result > 10 ** 18:
            result = -1
            break
print(result)

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

for i, alst in enumerate(a_lst):
    if i == 0:
        b = alst
    else:
        b = b * alst

if b > 1000000000000000000:
    print('-1')
else:
    print(b)

Fixed submission:
N = int(input())
A= list(map(int, input().split()))
result=1
if 0 in A:
    result = 0
else:
    for t in range(N):
        result *= A[t]
        if result > 10 ** 18:
            result = -1
            break
print(result)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
a, b = input().split()
a = int(a)
b = decimal.Decimal(b)
c = a*b*100//100
print(int(c))

Fixed submission:
from decimal import Decimal
a, b = input().split()
a = int(a)
b = Decimal(b)
c = a*b*100//100
print(int(c))
Buggy python submission (verdict: Runtime Error):
a_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
a = int(input())
print(a_list[a+1])

Fixed submission:
a_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
a = int(input())
print(a_list[a-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s_word = list(input())
start_w = s_word[0]
goal_num = 0
for i in range(n-1):
    if s_word[i+1] != start_w:
        start_w = s_word[i+1]
        goal_num += 1
goal_num +=1
print(res)

Fixed submission:
n = int(input())
s_word = list(input())
start_w = s_word[0]
goal_num = 0
for i in range(n-1):
    if s_word[i+1] != start_w:
        start_w = s_word[i+1]
        goal_num += 1
goal_num +=1
print(goal_num)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s_word = list(input())
start_w = s_word[0]
goal_num = 0
for i in range(n-1):
    if s_word[i+1] != start_w:
        start_w = s_word[i+1]
        res += 1
res +=1
print(res)

Fixed submission:
n = int(input())
s_word = list(input())
start_w = s_word[0]
goal_num = 0
for i in range(n-1):
    if s_word[i+1] != start_w:
        start_w = s_word[i+1]
        goal_num += 1
goal_num +=1
print(goal_num)
Buggy python submission (verdict: Runtime Error):
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")

Fixed submission:
s = input()
if s == 'Sunny':
    print('Cloudy')
if s == 'Cloudy':
    print('Rainy')
if s == 'Rainy':
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
def calc_minus(n):
    return n - 1

n, k, q = map(int, input().split())
a_list = [k] * n
# for _ in range(n):
#     a_list.append(k)
#print(a_list)
for _ in range(q):
    a = int(input())
    a_list = list(map(calc_minus, a_list))
    #print(a_list)
    a_list[a-1] = a_list[a-1] + 1
    #print(a_list)

#print(a_list)
for j in a_list:
    if int(j) > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
a_list = [k] * n
# for _ in range(n):
#     a_list.append(k)
#print(a_list)
for _ in range(q):
    a = int(input())
    a_list = list(map(calc_minus, a_list))
    #print(a_list)
    a_list[a-1] = a_list[a-1] + 1
    #print(a_list)

#print(a_list)
for j in a_list:
    if int(j) > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
def calc_minus(n):
    return n - 1

n, k, q = map(int, input().split())
a_list = []
for _ in range(n):
    a_list.append(k)
#print(a_list)
for _ in range(q):
    a = int(input())
    a_list = list(map(calc_minus, a_list))
    #print(a_list)
    a_list[a-1] = a_list[a-1] + 1
    #print(a_list)

#print(a_list)
for j in a_list:
    if int(j) > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
line = list(map(int,input().split()))
ans = 1
for i in range(n):
  ans *= line[i]
if ans > 10**18:
  print("-1")
else:
  print(ans)

Fixed submission:
n = int(input())
line = list(map(int,input().split()))
ans = 1
for i in range(n):
  if line[i] == 0:
    print(0)
    exit()
for i in range(n):
  ans *= line[i]
  if ans > 10**18:
    ans = -1
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  ns = s[:k]
  print(ns + "...")

Fixed submission:
n = list(input())
l = n[-1]
if l == "3":
  print("bon")
elif l == "0" or l == "6" or l == "1" or l == "8":
  print("pon")
else:
  print("hon")
Buggy python submission (verdict: Runtime Error):
3 4 10 40

Fixed submission:
import math
a,b,h,m = map(int,input().split())
N = 360*m/60
M = 30*h + 30*m/60
siita = abs(N - M)
if siita >= 180:
  siita = 360 - siita
ans = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians((siita))))
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
long = len(s)
count = 0
for i in range(long):
  for j in range(i+1,long):
    num = int(s[i:j+1])
    if len(str(num)) < 4:
      continue
    if num % 2019 == 0:
      count += 1
print(count)

Fixed submission:
s,w = map(int,input().split())
if w < s:
  print("safe")
else:
  print("unsafe")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
line = list(map(int,input().split()))
box = {}
for i in range(1,n+1):
  box[i] = 0
  for j in range(n-1):
    if  i == line[j]:
      box[i] += 1
for k in range(1,n+1):
  print(box[k])

Fixed submission:
import collections
n = int(input())
line = list(map(int,input().split()))
c = collections.Counter(line)
for k in range(1,n):
  print(c[k])
print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input)
Flag = False
for i in n:
  if i == 7:
    Flag = True
if Flag:
  print("Yes")
else:
  print("No")
  

Fixed submission:
n = input()
Flag = False
for i in n:
  if i == "7":
    Flag = True
if Flag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
box = []
for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1,k+1):
      gap = math.gcd(i,j)
      gap2 = math.gcd(gap,l)
      box.append(gap2)
print(sum(box))

Fixed submission:
import math
k = int(input())
box = []
for i in range(1,k+1):
  for j in range(1,k+1):
    gap = math.gcd(i,j)
    if gap == 1:
      box.append(1*k)
    else:
      for l in range(1,k+1):
        gap2 = math.gcd(gap,l)
        box.append(gap2)        
print(sum(box))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
answer = 0
if k == 1:
  answer = 0
elif k >= n:
  gap = k-n
  if gap > n:
    answer = n
  else:
    answer = gap
else:
  while n > k:
    n = n - k
  if k >= n:
    gap = k-n
    if gap > n:
      answer = n
    else:
      answer = gap
print(answer)

Fixed submission:
n,k = map(int,input().split())
answer = 0
if k >= n:
  gap = k-n
  if gap > n:
    answer = n
  else:
    answer = gap
else:
  sho = n // k
  if n % k == 0:
    dec = sho - 1
  else:
    dec = sho
  n = n - k*dec
  if k >= n:
    gap = k-n
    if gap > n:
      answer = n
    else:
      answer = gap
print(answer)
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
lines = []
for i in range(n):
  x,l = map(int,input().split())
  lines.append([x-l,x+l])
lines = sorted(lines)
count = 0
kari = -9999999999999
for i in range(n):
  if lines[i][0] >= kari:
    count += 1
    kari = lines[i][1]
print(count)
n = int(input())

lines = []
for i in range(n):
  x,l = map(int,input().split())
  lines.append([x-l,x+l])
lines = sorted(lines,key = lambda x:x[1])
count = 0
kari = -9999999999999
for i in range(n):
  if lines[i][0] >= kari:
    count += 1
    kari = lines[i][1]
print(count)


Fixed submission:
n = int(input())
 
lines = []
for i in range(n):
  x,l = map(int,input().split())
  lines.append([x-l,x+l])
lines = sorted(lines,key=lambda x:x[1])
count = 0
kari = -9999999999999
for i in range(n):
  if lines[i][0] >= kari:
    count += 1
    kari = lines[i][1]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
box = []
for i in range(n):
  W,V = map(int,input().split())
  box.append([W,V])
dp = [[0 for i in range(w+1)] for j in range(n+1)]

for i in range(1,n+1):
  for j in range(w+1):
    if j >= box[i-1][0]:
      dp[i][j] = max(dp[i-1][j-box[i-1][0]] + box[i-1][1] ,dp[i-1][j])
    else:
      dp[i][j] = dp[i-1][j]
print(dp[n][w])

Fixed submission:
n,w = map(int,input().split())
box = []
for i in range(n):
  W,V = map(int,input().split())
  box.append([W,V])
dp = [[0 for i in range(w+1)] for j in range(n+1)]

for i in range(1,n+1):
  for j in range(w+1):
    if j >= box[i-1][0]:
      dp[i][j] = max(dp[i-1][j-box[i-1][0]] + box[i-1][1] ,dp[i-1][j])
    else:
      dp[i][j] = dp[i-1][j]
print(dp[n][w])
Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
box = []
v = []
for i in range(n):
  W,V = map(int,input().split())
  box.append([W,V])
  v.append(V)
vmax = n*max(v)
inf = float('inf')
dp = [[inf for i in range(vmax+1)] for j in range(n+1)]
dp[0][0] = 0
for i in range(1,n+1):
  for j in range(vmax+1):
    if j >= box[i-1][1]:
      dp[i][j] = min(dp[i-1][j-box[i-1][1]] + box[i-1][0],dp[i-1][j])
    else:
      dp[i][j] = min(dp[i][j],dp[i-1][j])
ans = []
for i in range(vmax+1):
  if dp[n][i] <= w:
    ans.append(i)
print(max(ans))

Fixed submission:
n,w = map(int,input().split())
box = []
v = []
for i in range(n):
  W,V = map(int,input().split())
  box.append([W,V])
  v.append(V)
vmax = n*max(v)
inf = float('inf')
dp = [[inf for i in range(vmax+1)] for j in range(n+1)]
dp[0][0] = 0
for i in range(1,n+1):
  for j in range(vmax+1):
    if j >= box[i-1][1]:
      dp[i][j] = min(dp[i-1][j-box[i-1][1]] + box[i-1][0],dp[i-1][j])
    else:
      dp[i][j] = min(dp[i][j],dp[i-1][j])
ans = []
for i in range(vmax+1):
  if dp[n][i] <= w:
    ans.append(i)
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(str,input()))
box = [0]*n
for i in range(n):
  count1 = 0
  count2 = 0
  for j in range(i):
    if s[j] == "W":
      count1 += 1
  for k in range(i+1,n):
    if s[k] == "E":
      count2 += 1
  total = count1 + count2
  box[i] = total
print(min(box))

Fixed submission:
n = int(input())
s = list(map(str,input()))
count = 0
for i in range(1,n):
  if s[i] == "E":
    count += 1
box = [0]*n
box[0] = count
for j in range(1,n):
  if s[j] == "E":
    count -= 1
  if s[j - 1] == "W":
    count += 1
  box[j] = count
print(min(box))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(str,input()))
l = len(s)
box = []
for i in range(l):
  count1 = 0
  count2 = 0
  for j in range(i):
    if s[j] == "W":
      count1 += 1
  for k in range(i+1,l):
    if s[k] == "E":
      count2 += 1
  total = count1 + count2
  box.append(total)
print(min(box))

Fixed submission:
n = int(input())
s = list(map(str,input()))
count = 0
for i in range(1,n):
  if s[i] == "E":
    count += 1
box = [0]*n
box[0] = count
for j in range(1,n):
  if s[j] == "E":
    count -= 1
  if s[j - 1] == "W":
    count += 1
  box[j] = count
print(min(box))
Buggy python submission (verdict: Runtime Error):
n = int(input())
line1 = list(map(int,input().split()))
line2 = list(map(int,input().split()))
sum1 = sum(line1)
sum2 = sum(line2)
count1 = line1[0]
count2 = 0
box = []
for i in range(1,n-1):
  count1 += line1[i]
  count2 += line2[i-1]
  totalgap = count2 +sum1 - count1
  box.append(totalgap)
print(sum1 + sum2 - min(box))

Fixed submission:
n = int(input())
line1 = list(map(int,input().split()))
line2 = list(map(int,input().split()))
sum1 = sum(line1)
sum2 = sum(line2)
count1 = 0
count2 = 0
box = []
for i in range(0,n):
  count1 += line1[i]
  count2 += line2[i]
  totalgap = count2 - line2[i] +sum1 - count1
  box.append(totalgap)
print(sum1 + sum2 - min(box))
Buggy python submission (verdict: Runtime Error):
(a,b) = input().split()
c = a*b
if c % 2 = 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
line = input().split(" ")
answer = int(line[0]) * int(line[1])
if answer % 2 == 1:
  print("Odd")
else:
  print("Even")
Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
count = 0
for a in range(2001):
  for b in range(2001):
    c = n - a - b
    if 10000*a + 5000*b + 1000*c == y and 0 <= c <= 2000:
      print(str(a) + " " + str(b) + " " + str(c))
      count += 1
      break
  if count == 1:
    break
if count == 1:
  break

Fixed submission:
n,y = map(int,input().split())
kekkas = []
for a in range(2001):
  for b in range(2001):
    kekka = 9000*a + 4000*b - (y - 1000*n)
    if kekka == 0:
      c = n - a - b
      if c >= 0:
        kekkas.append((a,b,c))
if len(kekkas) > 0 :
  print(str(kekkas[0][0]) + " " + str(kekkas[0][1]) + " " + str(kekkas[0][2]))
else:
  print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
box = []
for a in range(2001):
  for b in range(2001):
    c = n - a - b
    if 10000*a + 5000*b + 1000*c == y and 0 <= c <= 2000:
      box.append([a,b,c])
print(str(box[0][0]) + " " + str(box[0][1]) + " " + str(box[0][2]))

Fixed submission:
n,y = map(int,input().split())
kekkas = []
for a in range(2001):
  for b in range(2001):
    kekka = 9000*a + 4000*b - (y - 1000*n)
    if kekka == 0:
      c = n - a - b
      if c >= 0:
        kekkas.append((a,b,c))
if len(kekkas) > 0 :
  print(str(kekkas[0][0]) + " " + str(kekkas[0][1]) + " " + str(kekkas[0][2]))
else:
  print("-1 -1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
x,y = map(int,input().split())
maxx = y//x + 1
count = 0
for i in range(maxx):
  if x*(2**i) <= y:
    count += 1
print(count)

Fixed submission:
x,y = map(int,input().split())
maxx = y//x + 1
count = 0
for i in range(maxx):
  if x*(2**i) <= y:
    count += 1
  else:
    break
print(count)
Buggy python submission (verdict: Runtime Error):
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)


Fixed submission:
line = input()
count = 0
for i in range(3):
  if line[i] == "1":
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)


Fixed submission:
line = input()
count = 0
for i in range(3):
  if line[i] == "1":
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
line = list(map(int,input().split()))
box = []
for j in line:
  for i in range(30):
    if j % 2**i != 0:
      box.append(i-1)
      break
print(min(box))

Fixed submission:
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)

Buggy python submission (verdict: Runtime Error):
n = int(input())
line = list(map(int,input().split()))
box = []
for j in line:
  for i in range(30):
    if j % 2**i != 0:
      box.append(i-1)
      break
print(max(box))


Fixed submission:
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)

Buggy python submission (verdict: Runtime Error):
n = int(input())
line = map(int,input().split())
box = []
for i in line:
  for j in range(1,10):
    if i % 2**j != 0:
      box.append(j - 1)
answer = min(box)
print(answer)

Fixed submission:
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)

Buggy python submission (verdict: Runtime Error):
n = int(input())
line = map(int,input().split())
box = []
for i in line:
  for j in range(1,9):
    if i % 2**j != 0:
      box.append(j - 1)
answer = min(box)
print(answer)

Fixed submission:
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)
Buggy python submission (verdict: Runtime Error):
sn = list(input())
t = list(input())
ls = len(sn)
lt = len(t)
Flag = False
reali = 0 #tの文が始まるときのi
for i in range(ls-lt+1): #スライスを繰り返して当てはまるところを探す
  ss = sn[i:i+lt]
  count = 0
  for j in range(lt):
    if ss[j] == "?" or ss[j] == t[j]:
      count += 1
  if count == lt:
    reali = i
    Flag = True
    break
for i in range(ls): #見つけたとこをtの文にしてそれ以外をaにする
  if i == reali:
    for j in range(lt):
      sn[i+j] = t[j]
  if sn[i] == "?":
    sn[i] = "a"
if Flag:
  for i in sn:
    print(i,end="")
else:
  print("UNRESTORABLE")

Fixed submission:
sn = list(input())
t = list(input())
ls = len(sn)
lt = len(t)
Flag = False  
reali = 0 #tの文が始まるときのi
if lt > ls:
  print("UNRESTORABLE")
  exit()
for i in range(ls-lt+1): #スライスを繰り返して当てはまるところを探す
  ss = sn[i:i+lt]
  count = 0
  for j in range(lt):
    if ss[j] == "?" or ss[j] == t[j]:
      count += 1
  if count == lt:
    reali = i
    Flag = True
for i in range(ls): #見つけたとこをtの文にしてそれ以外をaにする
  if i == reali:
    for j in range(lt):
      sn[i+j] = t[j]
  if sn[i] == "?":
    sn[i] = "a"
if Flag:
  for i in sn:
    print(i,end="")
else:
  print("UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
sn = list(input())
t = list(input())
ls = len(sn)
lt = len(t)
Flag = False
reali = 0
for i in range(ls-lt+1):
  ss = sn[i:i+lt]
  count = 0
  for j in range(lt):
    if ss[j] == "?" or ss[j] == t[j]:
      count += 1
  if count == lt:
    reali = i
    Flag = True
    break
for i in range(ls):
  if i == reali:
    for j in range(lt):
      sn[i+j] = t[j]
  if sn[i] == "?":
    sn[i] = "a"
if Flag:
  for i in sn:
    print(i,end="")
else:
  print("UNRESTORABLE")

Fixed submission:
sn = list(input())
t = list(input())
ls = len(sn)
lt = len(t)
Flag = False  
reali = 0 #tの文が始まるときのi
if lt > ls:
  print("UNRESTORABLE")
  exit()
for i in range(ls-lt+1): #スライスを繰り返して当てはまるところを探す
  ss = sn[i:i+lt]
  count = 0
  for j in range(lt):
    if ss[j] == "?" or ss[j] == t[j]:
      count += 1
  if count == lt:
    reali = i
    Flag = True
for i in range(ls): #見つけたとこをtの文にしてそれ以外をaにする
  if i == reali:
    for j in range(lt):
      sn[i+j] = t[j]
  if sn[i] == "?":
    sn[i] = "a"
if Flag:
  for i in sn:
    print(i,end="")
else:
  print("UNRESTORABLE")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
count = 0
setnums = set(nums)
for j in setnums:
  test = nums.count(j)
  if test % 2 == 1:
    count += 1
print(count)

Fixed submission:
from collections import defaultdict
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
d = defaultdict(int)
for j in nums:
  d[j] += 1
count = 0
for k in d.values():
  if k % 2 == 1:
    count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
count = 0
setnums = set(nums)
for j in setnums:
  test = nums.count(j)
  if test % 2 == 1:
    count += 1
print(count)

Fixed submission:
from collections import defaultdict
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
d = defaultdict(int)
for j in nums:
  d[j] += 1
count = 0
for k in d.values():
  if k % 2 == 1:
    count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
count = 0
for j in nums:
  test = nums.count(j)
  if test % 2 == 1:
    count += 1
print(count)

Fixed submission:
from collections import defaultdict
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
d = defaultdict(int)
for j in nums:
  d[j] += 1
count = 0
for k in d.values():
  if k % 2 == 1:
    count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
count = 0
for j in nums:
  test = nums.count(j)
  if test % 2 == 1:
    count += 1
print(count)

Fixed submission:
from collections import defaultdict
n = int(input())
nums = []
for i in range(n):
  num = int(input())
  nums.append(num)
d = defaultdict(int)
for j in nums:
  d[j] += 1
count = 0
for k in d.values():
  if k % 2 == 1:
    count += 1
print(count)