Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = nnk[0]
k = nnk[1]

hs = [int(input()) for l in range(n)]
hs.sort()

num = n - k + 1

hmmm = []
for l in range(num):
    hmmm.append(hs[k+l-1] - hs[l])

hmmm.sort()
print(hmm[0])


Fixed submission:
nnk = input().split(" ")
n = int(nnk[0])
k = int(nnk[1])

hs = [int(input()) for l in range(n)]
hs.sort()

hmmm = []
for m in range(n-k+1):
    hmmm.append(hs[k+m-1] - hs[m])

hmmm.sort()
print(hmmm[0])

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-


nnk = list(map(lambda x: int(x), input().split(" ")))
n = nnk[0]
k = nnk[1]

hs = [int(input()) for l in range(n)]
hs.sort()

num = n - k + 1

hmmm = []
for l in range(num):
    hmmm.append(hs[k+l-1] - hs[l])

hmmm.sort()
print(hmm[0])

Fixed submission:
nnk = input().split(" ")
n = int(nnk[0])
k = int(nnk[1])

hs = [int(input()) for l in range(n)]
hs.sort()

hmmm = []
for m in range(n-k+1):
    hmmm.append(hs[k+m-1] - hs[m])

hmmm.sort()
print(hmmm[0])
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if len(A) > len(B):
    print('GREATER')
elif len(A) < len(B):
    print('LESS')
elif A == B:
    print('EQUAL')
else:
    a = [int(i) for i in str(A)]
    b = [int(j) for j in str(B)]
    for i in range(len(A)):
        if A[i] > B[i]:
            print('GREATER')
            break
        elif A[i] < B[i]:
            print('LESS')
            break

Fixed submission:
A = int(input())
B = int(input())
if A > B:
    print('GREATER')
elif A < B:
    print('LESS')
else:
    print('EQUAL')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
s = raw_input().split()[0]
t = raw_input().split()[0]

s1 = list(s)
t1 = list(t)

s1.sort
t1.sort(reverse=True)

if s1<t1:
  print 'Yes'
else:
  print 'No'

Fixed submission:
# coding: utf-8
import math

a,b = map(int,raw_input().split())
print -(-(a+b)//2)
Buggy python submission (verdict: Runtime Error):
s = map(int, list(raw_input())) #入力した時にリストでSを配列
print sum(s) #s[0]~s[N]までの合計を出す

Fixed submission:
# -*- coding: utf-8 -*-
s = map(int, list(raw_input())) #入力した時にリストでSを配列
print sum(s) #s[0]~s[N]までの合計を出す
Buggy python submission (verdict: Runtime Error):
s =map(str,(raw_input()))
flg = 0
for i in range(len(s)):
  if flg==0 and s[i]=='A':
    flg += 1
  elif flg!=0 and s[i]=='Z':
    flg+=1
    if s[i+1] == 'Z':
      flg+=1
    break
  elif flg!=0:
    flg+=1
print flg

Fixed submission:
s =map(str,(raw_input()))
a = 0
z = 0
for i in range(len(s)):
  if s[i]=='A':
    a = i
    break
for i in range(len(s)):
  if s[-i-1]=='Z':
    z=len(s)-i-1
    break
print z-a+1
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,raw_input().split())
Count = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z==S:
        Count +=1
print Count

Fixed submission:
K,S = map(int,raw_input().split())
Count = 0
for x in range(K+1):
  for y in range(K+1):
    if 0<=S-(x+y)<=K:
      Count +=1
print Count
Buggy python submission (verdict: Runtime Error):

n = int(input())
if n ==1:
    print("Hello World")
elif n==2:
    a, b = map(int, input().split())
    print(a+b)

Fixed submission:

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a+b)

Fixed submission:

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a+b)

Fixed submission:

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n = in(input())
if n ==1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a+b)

Fixed submission:

n = int(input())
if n ==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
print(min(costs))

Fixed submission:
n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<=t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
if costs ==[]:
    print('TLE')
else:
    print(min(costs))
Buggy python submission (verdict: Runtime Error):
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = max(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
max_ans = min(max_ans, 9)

print min_ans, max_ans


Fixed submission:
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = min(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
#max_ans = min(max_ans, 8)

print min_ans, max_ans

Buggy python submission (verdict: Runtime Error):
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = ans
max_ans = ans + color[8]
max_ans = max(min(max_ans, 9), 1)

print min_ans, max_ans


Fixed submission:
n = input()
a = map(int, raw_input().split())
color = [0 for _ in range(9)]
for item in a:
    i = item / 400
    i = min(i, 8)
    color[i] += 1

ans = 0
for num in color[0:8]:
    if num != 0:
        ans += 1

min_ans = max(ans, 1)
max_ans = ans + color[8]
#max_ans = min(max_ans, 8)

print min_ans, max_ans
Buggy python submission (verdict: Runtime Error):
n = input()
if n > = 1200:
    print "ARC"
else:
    print "ABC"

Fixed submission:
n = input()
if n >= 1200:
    print "ARC"
else:
    print "ABC"
Buggy python submission (verdict: Runtime Error):
a, b, c = map(str, raw_input().split(","))
a = int(a)
c = int(c)
if b == "+":
    print a + c
else:
    print a - c


Fixed submission:
a, b, c = map(str, raw_input().split())
a = int(a)
c = int(c)
if b == "+":
    print a + c
else:
    print a - c
Buggy python submission (verdict: Runtime Error):
X = int(input())
if X==3 or X==5 or X==6:print("YES")
  else:print("NO")

Fixed submission:
x = int(input())
if x==3 or x==5 or x==7:print("YES")
else:print("NO")
Buggy python submission (verdict: Runtime Error):
from sys import stdin
a = stdin.readline().rstrip()
w=int(a)
j=1
sumvalue=0
maxvalue=0
while j<=w:
    a = stdin.readline().rstrip()
    sumvalue+=int(a)
    maxvalue=max(maxvalue,int(a))
print(sumvalue-int(maxvalue/2))

Fixed submission:
from sys import stdin
a = stdin.readline()
w=int(a)
j=1
sumvalue=0
maxvalue=0
w2=[]
while j<=w:
    z = stdin.readline().rstrip('\n')
    sumvalue+=int(z)
    maxvalue=max(maxvalue,int(z))
    j+=1
print(sumvalue-int(maxvalue/2))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
a = stdin.readline().split(" ")
num=int(a[0])
find=int(a[1])
j=1
w2=[]
while j<=num:
    z = stdin.readline().rstrip('\n')
    w2.append(int(z))
    j+=1
w2.sort()
minnum=w2[find-1]-w2[0]
for i in range(len(w2)-2):
    minnum=min(minnum,w2[i+find-1]-w2[i])
print(minnum)


Fixed submission:
from sys import stdin
a = stdin.readline().split(" ")
num=int(a[0])
find=int(a[1])
j=1
w2=[]
while j<=num:
    z = stdin.readline().rstrip('\n')
    w2.append(int(z))
    j+=1
w2.sort()
minnum=w2[find-1]-w2[0]
for i in range(len(w2)-find+1):
    minnum=min(minnum,w2[i+find-1]-w2[i])
print(minnum)
Buggy python submission (verdict: Runtime Error):
one=list(input())
#print(one)
two=list(input())

for num,i in enumerate(one):
    if i not in z:
        z[i]=[num]
    else:
        z[i].append(num)
p={}
for num,i in enumerate(two):
    if i not in p:
        p[i]=[num]
    else:
        p[i].append(num)
w=[]
#print(p)
#print(z)
for k,v in z.items():
    w.append(v)
o=[]
for k,v in p.items():
    o.append(v)
print("Yes") if w==o else print("No")

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

one.sort()
print(10*one[2]+one[1]+one[0])
Buggy python submission (verdict: Runtime Error):
one=list(input())
#print(one)
two=list(input())

for num,i in enumerate(one):
    if i not in z:
        z[i]=[num]
    else:
        z[i].append(num)
p={}
for num,i in enumerate(two):
    if i not in p:
        p[i]=[num]
    else:
        p[i].append(num)
w=[]
#print(p)
#print(z)
for k,v in z.items():
    w.append(v)
o=[]
for k,v in p.items():
    o.append(v)
print("Yes") if w==o else print("No")

Fixed submission:
def main():
    data0 = input()
    data1 = input()

    flag = True
    data_tmp = data0
    count = 0
    len_data = len(data0)
    while True:
        if data0 == "":
            break

        data0 = data0.replace(data0[0], "")
        data1 = data1.replace(data1[0], "")

        if len(data0) != len(data1):
            print('No')
            exit()

    print('Yes')

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
one=list(input())
#print(one)
two=list(input())
if one==[] or two==[]
z={}
for num,i in enumerate(one):
    if i not in z:
        z[i]=[num]
    else:
        z[i].append(num)
p={}
for num,i in enumerate(two):
    if i not in p:
        p[i]=[num]
    else:
        p[i].append(num)
w=[]
#print(p)
#print(z)
for k,v in z.items():
    w.append(v)
o=[]
for k,v in p.items():
    o.append(v)
print("Yes") if w==o else print("No")

Fixed submission:
def main():
    data0 = input()
    data1 = input()

    flag = True
    data_tmp = data0
    count = 0
    len_data = len(data0)
    while True:
        if data0 == "":
            break

        data0 = data0.replace(data0[0], "")
        data1 = data1.replace(data1[0], "")

        if len(data0) != len(data1):
            print('No')
            exit()

    print('Yes')

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def cal(N, i):
    if N > 0:
        return 2 * cal(N - 1, i) + i
    elif N == 0:
        return 1
    else:
        return 0

def pCal(N ,X):
    total = cal(N, 3)
    half = total // 2
    pTmp = cal(N - 1, 1)
    if X == 1 and N == 0:
        return 1
    elif X <= N:
        return 0
    elif X < half:
        return pCal(N - 1, X - 1)
    elif X == half:
        return pTmp
    elif X == half + 1:
        return pTmp + 1
    elif total > X > half + 1:
        return (pTmp + 1) + pCal(N - 1, X - (half + 1))
    elif x == total:
        return cal(N, 1)
N, X = list(map(int, input().split()))
print(pCal(N, X))

Fixed submission:
def cal(N, i):
    if N > 0:
        return 2 * cal(N - 1, i) + i
    elif N == 0:
        return 1
    else:
        return 0

def pCal(N ,X):
    total = cal(N, 3)
    half = total // 2
    pTmp = cal(N - 1, 1)
    if X == 1 and N == 0:
        return 1
    elif X <= N:
        return 0
    elif X < half:
        return pCal(N - 1, X - 1)
    elif X == half:
        return pTmp
    elif X == half + 1:
        return pTmp + 1
    elif total > X > half + 1:
        return (pTmp + 1) + pCal(N - 1, X - (half + 1))
    elif X == total:
        return cal(N, 1)
N, X = list(map(int, input().split()))
print(pCal(N, X))

Buggy python submission (verdict: Runtime Error):
def cal(N, i):
    if N > 0:
        return 2 * cal(N - 1, i) + i
    elif N == 0:
        return 1
    else:
        return 0

def pCal(N ,X):
    total = cal(N, 3)
    half = total // 2
    pTmp = cal(N - 1, 1)
    if X == 1 and N == 0:
        return 1
    elif X <= N:
        return 0
    elif X < half:
        return pCal(N - 1, X - 1)
    elif X == half:
        return pTmp
    elif X == half + 1:
        return pTmp + 1
    elif total > X > half + 1:
        return (pTmp + 1) + pCal(N - 1, X - (half + 1))
    else x == total
        return cal(N, 1)
N, X = list(map(int, input().split()))
print(pCal(N, X))

Fixed submission:
def cal(N, i):
    if N > 0:
        return 2 * cal(N - 1, i) + i
    elif N == 0:
        return 1
    else:
        return 0

def pCal(N ,X):
    total = cal(N, 3)
    half = total // 2
    pTmp = cal(N - 1, 1)
    if X == 1 and N == 0:
        return 1
    elif X <= N:
        return 0
    elif X < half:
        return pCal(N - 1, X - 1)
    elif X == half:
        return pTmp
    elif X == half + 1:
        return pTmp + 1
    elif total > X > half + 1:
        return (pTmp + 1) + pCal(N - 1, X - (half + 1))
    elif X == total:
        return cal(N, 1)
N, X = list(map(int, input().split()))
print(pCal(N, X))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]].append(i[1])
    else:
        d[i[0]] = [i[1]]
for i in PY:
    print(str(i[0]).zfill(6) + str(d[i[0]].index(i[1]) + 1).zfill(6))

Fixed submission:
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) + [i, 0] for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]] += 1
    else:
        d[i[0]] = 1
    i[3] = d[i[0]]
for i in PY:
    print(str(i[0]).zfill(6) + str(i[3]).zfill(6))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) for i in range(M)]
PYS = sorted(PY, key=lambda x: (x[0], x[1]))
d = {}
for i in PYS:
    if i[0] in d:
        d[i[0]].append(i[1])
    else:
        d[i[0]] = [i[1]]
for i in PY:
    print(str(i[0]).zfill(6) + str(d[i[0]].index(i[1]) + 1).zfill(6))

Fixed submission:
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) + [i, 0] for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]] += 1
    else:
        d[i[0]] = 1
    i[3] = d[i[0]]
for i in PY:
    print(str(i[0]).zfill(6) + str(i[3]).zfill(6))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) for i in range(M)]
d = {}
for i in PY:
    if i[0] in d:
        d[i[0]].append(i[1])
    else:
        d[i[0]] = [i[1]]
for k, v in d.items():
    v.sort()
for i in PY:
    print(str(i[0]).zfill(6) + str(d[i[0]].index(i[1]) + 1).zfill(6))

Fixed submission:
N, M = list(map(int, input().split()))
PY = [list(map(int, input().split())) + [i, 0] for i in range(M)] 
d = {}
for i in sorted(PY, key=lambda x: x[1]):
    if i[0] in d:
        d[i[0]] += 1
    else:
        d[i[0]] = 1
    i[3] = d[i[0]]
for i in PY:
    print(str(i[0]).zfill(6) + str(i[3]).zfill(6))
Buggy python submission (verdict: Runtime Error):
i = lambda: list(map(int, input().split()))
N, = i()
M = [i() for j in range(N)]
H = 0
for k in range(101):
    if M[i][2] != 0:
        H = abs(M[0][0] - Cx) + abs(M[0][1] - Cy) + M[0][2]
        break
for Cx in range(101):
    for Cy in range(101):
        if all([False for d in M if H != abs(d[0] - Cx) + abs(d[1] - Cy) + d[2]]):
            print(Cx, Cy, H)

Fixed submission:
i = lambda: list(map(int, input().split()))
N, = i()
M = [i() for j in range(N)]
k = -1
for k in range(len(M)):
    if M[k][2] > 0:
        break
for Cx in range(101):
    for Cy in range(101):
        H = abs(M[k][0] - Cx) + abs(M[k][1] - Cy) + M[k][2]
        if all([False for d in M if d[2] != max(H - abs(d[0] - Cx) - abs(d[1] - Cy), 0)]):
            print(Cx, Cy, H)
            break
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
for i in range(M // N + 1)[::-1]:
    if M % i == 0:
        print(i)
        break

Fixed submission:
N, M = map(int,input().split())
a, b = 1, M
divisor = []
while a <= b:
    if a * b == M:
        divisor.append(a)
        divisor.append(b)
    a = M // b + 1
    b = M // a
divisor.sort()
for i in divisor:
    if i >= N:
        print(M // i)
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = [{}, {}]
for i, vi in enumerate(map(int, input().split())):
    j = i % 2
    if vi in v[j]:
        v[j][vi] += 1
    elif not (vi in v[j]):
        v[j][vi] = 1
f1 = lambda v, i: max(v[i], key=v[i].get) if len(v[i]) > 0 else 0
f2 = lambda v, i, k: v[i].pop(k) if len(v[i]) > 0 else 0
kMax = [[f1(v, 0), f1(v, 1)]]
vMax = [[f2(v, 0, kMax[0][0]), f2(v, 1, kMax[0][1])]]
if kMax[0][0] != kMax[0][1]:
    print(n - sum(vMax[0]))
else:
    kMax.append([f1(v, 0), f1(v, 1)])
    vMax.append([f2(v, 0, kMax[0][0]), f2(v, 1, kMax[0][1])])
    print(n - max([vMax[0][0] + vMax[1][1], vMax[0][1] + vMax[1][0]]))

Fixed submission:
n = int(input())
v = [{}, {}]
for i, vi in enumerate(map(int, input().split())):
    j = i % 2
    v[j].update([(vi, v[j][vi] + 1)]) if vi in v[j] else v[j].update([(vi, 1)])
f1 = lambda v, i: max(v[i], key=v[i].get) if len(v[i]) > 0 else 0
f2 = lambda v, i, k: v[i].pop(k) if len(v[i]) > 0 else 0
kMax, vMax = [], []
for i in [0, 1]:
    kMax.append([f1(v, 0), f1(v, 1)])
    vMax.append([f2(v, 0, kMax[i][0]), f2(v, 1, kMax[i][1])])
if kMax[0][0] != kMax[0][1]:
    print(n - sum(vMax[0]))
else:
    print(n - max([vMax[0][0] + vMax[1][1], vMax[0][1] + vMax[1][0]]))
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial as f
N, M = map(int, input().split())
a1, a2 = 2, M
a = {}
while (a1 - 1) ** 2 <= a2 or a1 == a2:
    if a2 % a1 == 0:
        a2 //= a1
        if a1 in a:
            a[a1] += 1
        else:
            a[a1] = 1
    else:
        a1 += 1
p = 1
if a2 != 1:
    a[a2] = 1
for v in a.values():
    p *= f(v + N - 1) // (f(v) * f(N - 1))
print(p % (10 ** 9 + 7))

Fixed submission:
N, M = map(int, input().split())
a1, a2 = 2, M
a = {}
while (a1 - 1) ** 2 <= a2 or a1 == a2:
    if a2 % a1 == 0:
        a2 //= a1
        if a1 in a:
            a[a1] += 1
        else:
            a[a1] = 1
    else:
        a1 += 1
p = 1
if a2 != 1:
    a[a2] = 1
for v in a.values():
    tmp = 1
    for i in range(v):
        tmp = tmp * (v + N - 1 - i) // (i + 1)
    p *= tmp
print(p % (10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from math import factorial as f
N, M = map(int, input().split())
a1, a2 = 2, M
a = []
while a2 != 1:
    if a2 % a1 == 0:
        a.append(a1)
        a2 //= a1
    else:
        a1 += 1
ca = Counter(a)
sa = sum(ca.values())
p = 1
for v in ca.values():
    p *= f(sa + v - 1) // (f(v) * f(sa - 1))
print(p * (f(N) // (f(sa) * f(N - sa))) % (10 ** 9 + 7))

Fixed submission:
N, M = map(int, input().split())
a1, a2 = 2, M
a = {}
while (a1 - 1) ** 2 <= a2 or a1 == a2:
    if a2 % a1 == 0:
        a2 //= a1
        if a1 in a:
            a[a1] += 1
        else:
            a[a1] = 1
    else:
        a1 += 1
p = 1
if a2 != 1:
    a[a2] = 1
for v in a.values():
    tmp = 1
    for i in range(v):
        tmp = tmp * (v + N - 1 - i) // (i + 1)
    p *= tmp
print(p % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
import sys

def main(lines):
    print(''.join(sorted(lines.split())))

next(sys.stdin)
for line in sys.stdin:
    lines += line
main(lines)


Fixed submission:
import sys

def main(lines):
    print(''.join(sorted(lines.split())))

next(sys.stdin)
lines = ''
for line in sys.stdin:
    lines += line
main(lines)
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N == 1:
    print("Hello World")
else:
    A,B = map(int, input().split())
    print(A+B)


Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])


Fixed submission:
import itertools
N, T = map(int, input().split())
CT = list(map(lambda _ :list(map(int, input().split())), range(N)))
if min(CT ,key = (lambda ct:ct[1]))[1] > T:
    print('TLE')
else:
    print(min(filter(lambda ct: ct[1]<=T, CT), key=(lambda ct: ct[0]))[0])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import string

S = input()
T = input()

S_ = []
T_ = []
for c in string.ascii_lowercase:
    S_.append(np.array(list(map(lambda x: 0 if c != x else 1, S))))
    T_.append(np.array(list(map(lambda x: 0 if c != x else 1, T))))

for s_ in S_:
    flag = False
    for i,t_ in enumerate(T_):
        if np.all(t_- s_ == 0):
            flag = True
            T_.pop(i)
            break
    if not flag:
        print("No")
        exit(0)

print("Yes")

    


Fixed submission:
#このコード
# aabbccdd
# ababcdcd
# をYesと通すのだが....

from collections import Counter
 
S = list(input())
T = list(input())
 
cs = sorted(Counter(S).values())
ct = sorted(Counter(T).values())
 
if cs == ct:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import string

S = input()
T = input()

S_ = []
T_ = []
for c in string.ascii_lowercase:
    S_.append(np.array(list(map(lambda x: 0 if c != x else 1, S))))
    T_.append(np.array(list(map(lambda x: 0 if c != x else 1, T))))

for s_ in S_:
    flag = False
    for t_ in T_:
        if np.all(t_- s_ == 0):
            flag = True
            break
    if not flag:
        print("No")
        exit(0)

print("Yes")

    


Fixed submission:
#このコード
# aabbccdd
# ababcdcd
# をYesと通すのだが....

from collections import Counter
 
S = list(input())
T = list(input())
 
cs = sorted(Counter(S).values())
ct = sorted(Counter(T).values())
 
if cs == ct:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
import scipy.special

N, M = map(int, input().split())

def factorize(M):
    P = []
    F = []
    for m in range(2, int(math.sqrt(M))+1):
        n = 0
        while M % m == 0:
            M/= m
            n +=1
        if n != 0:
            P.append(m)
            F.append(n)
    if M != 1:
        P.append(M)
        F.append(1)
    return P,F

P, F = factorize(M)

X = 1
for f in F:
    X *= int(scipy.special.comb(N+f-1, f, exact=True))
    X %= int(pow(10,9)+7)

print(X)
    
     


Fixed submission:
import math
from scipy.misc import comb

N, M = map(int, input().split())

def factorize(M):
    P = []
    F = []
    for m in range(2, int(math.sqrt(M))+1):
        n = 0
        while M % m == 0:
            M/= m
            n +=1
        if n != 0:
            P.append(m)
            F.append(n)
    if M != 1:
        P.append(M)
        F.append(1)
    return P,F

P, F = factorize(M)

X = 1
for f in F:
    X *= int(comb(N+f-1, f, exact=True))
    X %= int(pow(10,9)+7)

print(X)
Buggy python submission (verdict: Runtime Error):
D=int(input())
if D==22:
  print(Christmas Eve Eve Eve)
elif D==23:
  print(Christmas Eve Eve)
elif D==24:
  print(Christmas Eve)
else:
  print(Christmas)

Fixed submission:
print('Christmas'+' Eve '*(25-int(input())))
Buggy python submission (verdict: Runtime Error):
X=input()
print(min(abs(int(S[i:i+3])-753) for i in range(len(S)-2)))


Fixed submission:
X=input()
print(min(abs(int(X[i:i+3])-753) for i in range(len(X)-2)))