Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input() 
K = int(input())

count = 0
S = S + "0"

i = 0
while i < len(S)-2:
    if S[i] == S[i+1]:
        count += 1
        i += 2
        """
        if S[i] == S[i+2]:
            i += 2
        else:
            i += 2
        """
    else:
        i += 1

S = S[:-1] #最後の0を削除

if len(S) == 1:
    result = K
elif len(S) == 2:
    result = count * K
else: #S[0]からの連続文字列数とS[-1]からの連続文字列数がどちらも奇数ならば「+ 1 × (K-1)」が必要
    if S[0] == S[-1]:
        len_first = 1
        i = 0
        while S[i] == S[i+1]:
            len_first += 1
            i += 1
        
        len_last = 1
        i = -1
        while S[i] == S[i-1]:
            len_last += 1
            i -= 1
        
        if len_first % 2 == 1 and len_last % 2 == 1:
            result = count * K + (K-1)
        else:
            result = count * K

              
        """
        if S[0] != S[1] and S[-1] != S[-2]:
            result = count * K + (K-1)
            #print("if1")
        elif S[0] == S[1] == S[2] and S[-1] != S[-2]: 
            result = count * K + (K-1)
            #print("if2")
        elif S[-1] == S[-2] == S[-3] and S[0] != S[1]: 
            result = count * K + (K-1)
            #print("if3")    
        else:
            result = count * K
            #print("else1")
        """

    else:
        result = count * K
        #print("else2")


print(result)




Fixed submission:
S = input()
K = int(input())
li = []
num = 1

#数えるセクション
for i in range(len(S)-1): #もしlen(S)==1の場合、ループは一回も回らない。（エラーもでない？）
    if S[i] == S[i+1]:
        num += 1
    else:
        li.append(num)
        num = 1
li.append(num)
#print(li)

#合計セクション
g = 0
for l in li:
    g += (l // 2)
#print(g)

#解答セクション
tmp = 0
result = 0
if len(li) == 1:
    result = (li[0] * K) // 2
else:
    tmp = sum(j // 2 for j in li)
    if S[0] != S[-1]:
        result = tmp * K
    else:
        if li[0] % 2 == li[-1] % 2 == 1: #最初と最後がどちらも奇数個の連続ならば、プラス1する必要がある。
            result = tmp * K + (1 * (K-1))
        else:
            result = tmp * K

print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0

for i in range (len(H)-1):
  if H[i] >= H[i+1]:
    count += 1
    result.append(count)
  else:
    result.append(count)
    count=0

print(max(result))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0
i = 0

for i in range (N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    result.append(count)
    count=0

"""
while i <= N-2:#Hの最終インデックスはN-1、最終インデックスの探索は不要なのでN-2とする
  if H[i] >= H[i+1]:
    count += 1
    i += 1
  else:
    result.append(count)
    i += count+1
    count = 0
"""

result.append(count) #最終インデックスが絡む部分は上記while内ではappendされないため

print(max(result))

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0

for i in range (len(H)-1):
  if H[i] >= H[i+1]:
    count += 1
    result.append(count)
  else:
    result.append(count)
    count=0

print(max(result))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0
i = 0

for i in range (N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    result.append(count)
    count=0

"""
while i <= N-2:#Hの最終インデックスはN-1、最終インデックスの探索は不要なのでN-2とする
  if H[i] >= H[i+1]:
    count += 1
    i += 1
  else:
    result.append(count)
    i += count+1
    count = 0
"""

result.append(count) #最終インデックスが絡む部分は上記while内ではappendされないため

print(max(result))

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0

for i in range (len(H)-1): # len(H) = 11, rangeは 0 ~ 10
  if H[i] >= H[i+1]:
    count += 1
  else:
    result.append(count)
    count=0
    continue
  result.append(count)

print(max(result))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0
i = 0

for i in range (N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    result.append(count)
    count=0

"""
while i <= N-2:#Hの最終インデックスはN-1、最終インデックスの探索は不要なのでN-2とする
  if H[i] >= H[i+1]:
    count += 1
    i += 1
  else:
    result.append(count)
    i += count+1
    count = 0
"""

result.append(count) #最終インデックスが絡む部分は上記while内ではappendされないため

print(max(result))
Buggy python submission (verdict: Runtime Error):
N = int(input())
r = range(N)
#print(r)
l = list(r)
#print(l)

if N == 1:
  print(1)
else:
  print(sum(l))

Fixed submission:
N = int(input())
result = int(N*(N-1)//2)

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
r = range(N)
print(r)
l = list(r)
print(l)

if N == 1:
  print(1)
else:
  print(sum(l))

Fixed submission:
N = int(input())
result = int(N*(N-1)//2)

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
r = range(N)
l = list(r)

print(sum(l))

Fixed submission:
N = int(input())
result = int(N*(N-1)//2)

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
r = range(N)
l = list(r)
sum = 0

for i in l:
  sum += l[i]

print(sum)
  


Fixed submission:
N = int(input())
result = int(N*(N-1)//2)

print(result)
Buggy python submission (verdict: Runtime Error):
count = int(input())
numlist = list(map(int, sorted(input().split())))
result = 0

"""
for i in range(count-1):
  result = (numlist[i+1] + numlist[i]) / 2
"""

  #resultの結果をもう一回listに戻してsortする必要があるかも
  
while len(numlist) >= 2:
  sum = (numlist[1] + numlist[0]) / 2
  del numlist[0:2] #0,1番目の要素を削除
  numlist.append(sum)
  numlist = sorted(numlist)
  #print(sum)
  #print(numlist)
  
print(sum)


Fixed submission:
a = int(input())
s = input()
 
if a >= 3200:
  print(s)
else:
  print("red")

Buggy python submission (verdict: Runtime Error):
a = input("input number: ")

if a < 28000 or a >= 5000:
  return false
elif a >= 3200:
  return s
else:
  return "red"

  

Fixed submission:
a = int(input())
s = input()
 
if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
n = int(input())

d = [int(input()) for i in range(n)]

deduplicate = set(d)

print(len(deduplicate))

Fixed submission:
s = str(input())

print("2018/01/{}{}".format(s[-2],s[-1]))
Buggy python submission (verdict: Runtime Error):
ls = list(map(int,input().split()))
n = ls[0]
a = ls[1]
b = ls[2]
c = 0

for i in n:
  s = sum(list(str(i)))
  c ++ 1 if s >= a and s <= b
  
print(c)

Fixed submission:
ls = list(map(int,input().split()))
n = ls[0]
a = ls[1]
b = ls[2]
r = 0

for i in range(1, n+1):
  s = sum(list(map(int, list(str(i)))))
  if s >= a and s <= b:
    r += i
  
print(r)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = map(int, input().split())
ans = 1
for a in l:
    if ans * a > 1e18:
        ans = -1
    else:
        ans *= a

print(ans)

Fixed submission:
n = int(input())
l = map(int, input().split())
ans = 1
for a in l:
    if ans * a > 1e18:
        ans = -1
    elif ans != -1 or a == 0:
        ans *= a

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1
for i in range(n):
    a = int(input())
    if ans * a > 1e18:
        ans = -1
    else:
        ans *= a

print(ans)

Fixed submission:
n = int(input())
l = map(int, input().split())
ans = 1
for a in l:
    if ans * a > 1e18:
        ans = -1
    elif ans != -1 or a == 0:
        ans *= a

print(ans)
Buggy python submission (verdict: Runtime Error):
xs = [int(input()) for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")


Fixed submission:
xs = [int(input()) for i in range(5)]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")

Buggy python submission (verdict: Runtime Error):
xs = [for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")


Fixed submission:
xs = [int(input()) for i in range(5)]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")

Buggy python submission (verdict: Runtime Error):
xs = [for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("YES")
else:
	print("NO")

Fixed submission:
xs = [int(input()) for i in range(5)]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = ""
if n < 1200:
	ans = "ABC"
else if n < 2800:
	ans = "ARC"
else:
	ans = "AGC"

print(ans)


Fixed submission:
n = int(input())
ans = ""
if n < 1200:
	ans = "ABC"
elif n < 2800:
	ans = "ARC"
else:
	ans = "AGC"

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

result = 0
ai = [0]*n
aj = [0]*n

for i in range(n):
    ai[i] = a[i]+i+1
    aj[i] = i+1-a[i]
    
for i in range(n-1):
    result += aj[i+1:].count(ai[i])
print(result)

Fixed submission:
import collections

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

result = 0
ai = [0]*n
aj = [0]*n

for i in range(n):
    ai[i] = a[i]+i+1
    aj[i] = i+1-a[i]
aj_num = collections.Counter(aj)
    
for i in range(n-1):
    aj_num[aj[i]] -= 1
    result += aj_num[ai[i]]
    
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce

k = int(input())

result = 0

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

for a in range(1, k+1):
    for b in range(a, k+1):
        for c in range(b, k+1):
            if a == b == c:
                result += a
            elif a == b and a!= c:
                result += gcd(a, c)*3
            elif a == c and a != b:
                result += gcd(a, b)*3
            elif b == c and a != b:
                result += gcd(a, b)*3
            else:
                result += gcd(a, b, c)*6
print(result)

Fixed submission:
import math
from functools import reduce

k = int(input())

result = 0

def gcd(*numbers):
    return reduce(math.gcd, numbers)

for a in range(1, k+1):
    for b in range(a, k+1):
        for c in range(b, k+1):
            if a == b == c:
                result += a
            elif a == b and a!= c:
                result += gcd(a, c)*3
            elif a == c and a != b:
                result += gcd(a, b)*3
            elif b == c and a != b:
                result += gcd(a, b)*3
            else:
                result += gcd(a, b, c)*6
print(result)
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

result = sum(p[:x]) + sum(q[:y])
i = 0
red_min = x-1
blue_min = y-1
flag = True

while flag == True:
    if r[i] > p[red_min] or r[i] > q[blue_min]:
        if p[red_min] < q[blue_min]:
            result = result - p[red_min] + r[i]
            i += 1
            red_min -= 1
        else:
            result = result - q[blue_min] + r[i]
            i += 1
            blue_min -= 1
    else:
        flag = False
print(result)
    

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

p.insert(0, 10**9)
p.append(0)
q.insert(0, 10**9)
q.append(0)
r.append(0)

result = sum(p[1:x+1]) + sum(q[1:y+1])
i = 0
red_min = x
blue_min = y
flag = True

while flag == True:
    if r[i] > p[red_min] or r[i] > q[blue_min]:
        if p[red_min] < q[blue_min]:
            result = result - p[red_min] + r[i]
            i += 1
            red_min -= 1
        else:
            result = result - q[blue_min] + r[i]
            i += 1
            blue_min -= 1
    else:
        flag = False
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

reverse_flag = 1

for _ in range(q):
    query = input().split()
    if query[0] == "1":
        reverse_flag *= -1
    else:
        if (query[1] == "1" and reverse_flag == 1) or (query[1] == "2" and reverse_flag == -1):
            s = query[2] + s
        else:
            s = s + query[2]
if reverse_flag == 1:
    print(s)
else:
    print("".join(list(reversed(s))))

Fixed submission:
from collections import deque

s = deque(input())
q = int(input())

reverse_flag = 1

for _ in range(q):
    query = input().split()
    if query[0] == "1":
        reverse_flag *= -1
    else:
        if (query[1] == "1" and reverse_flag == 1) or (query[1] == "2" and reverse_flag == -1):
            s.appendleft(query[2])
        else:
            s.append(query[2])
if reverse_flag == 1:
    print("".join(s))
else:
    s.reverse()
    print("".join(s))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n = int(input())
s = list(input() for _ in range(n))

s_set = sorted(list(set(s)))
s_num = [0]*len(s_set)

for i in range(n):
    s_num[s_set.index(s[i])] += 1

ans_num = max(s_num)
for i in range(len(s_set)):
    if s_num[i] == ans_num:
        print(s_set[i])

Fixed submission:
from collections import Counter

n = int(input())
s_list = sorted(list(input() for _ in range(n)))

s = Counter(s_list)

ans_num = s.most_common(1)[0][1]

s_1 = sorted(list(s.items()), key=lambda x: x[0])

for i in range(len(s_1)):
    if s_1[i][1] == ans_num:
        print(s_1[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n = int(input())
s = list(input() for _ in range(n))

s_set = sorted(list(set(s)))
s_num = [0]*len(s_set)

for i in range(n):
    s_num[s_set.index(s[i])] += 1

ans_num = max(s_num)
for i in range(len(s_set)):
    if s_num[i] == ans_num:
        print(s_set[i])

Fixed submission:
from collections import Counter

n = int(input())
s_list = sorted(list(input() for _ in range(n)))

s = Counter(s_list)

ans_num = s.most_common(1)[0][1]

s_1 = sorted(list(s.items()), key=lambda x: x[0])

for i in range(len(s_1)):
    if s_1[i][1] == ans_num:
        print(s_1[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))

a = []
a_num = []

for i in range(n):
    if s[i] not in a:
        a.append(s[i])
        a_num.append(0)
    else:
        a_num[a.index(s[i])] += 1

ans_num = max(a_num)
ans = []

for i in range(len(a)):
    if a_num[i] == ans_num:
        ans.append(a[i])
ans.sort()
print("\n".join(ans))

Fixed submission:
from collections import Counter

n = int(input())
s_list = sorted(list(input() for _ in range(n)))

s = Counter(s_list)

ans_num = s.most_common(1)[0][1]

s_1 = sorted(list(s.items()), key=lambda x: x[0])

for i in range(len(s_1)):
    if s_1[i][1] == ans_num:
        print(s_1[i][0])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

ans_i = 0
ans_max = 0
ans = 0

for i in range(0, n-k+1):
    x = sum(p[i:i+k])
    if x > ans_max:
        ans_max = x
        ans_i = i
        
for j in range(ans_i, ans_i+k):
    ans += (p[j]+1)/2
print(ans)

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

x = sum(p[0:k])
ans_i = 0
ans_max = x
ans = 0

for i in range(1, n-k+1):
    x = x - p[i-1] + p[i+k-1]
    if x > ans_max:
        ans_max = x
        ans_i = i
        
for j in range(ans_i, ans_i+k):
    ans += (p[j]+1)/2
print(ans)

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

ans = 0

for i in range(0, n-k+1):
    x = 0
    for j in range(k):
        x += (p[i+j] + 1)/2
    ans = max(ans, x)
print(ans)

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

x = sum(p[0:k])
ans_i = 0
ans_max = x
ans = 0

for i in range(1, n-k+1):
    x = x - p[i-1] + p[i+k-1]
    if x > ans_max:
        ans_max = x
        ans_i = i
        
for j in range(ans_i, ans_i+k):
    ans += (p[j]+1)/2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

cnt = 0

for i in range(n):
    if p[i] == min(p[:i+1]):
        cnt += 1
print(cnt)

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

cnt = 0
x = p[0]

for i in range(n):
    if p[i] <= x:
        cnt += 1
    x = min(x, p[i])
print(cnt)
Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
from sympy import isprime
x = int(input())
if isprime(x):
    print(x)
else:
    print(nextprime(x))

Fixed submission:
import math
x = int(input())
def check(x):
    for i in range(2, int(math.sqrt(x) + 1)):
        if x % i == 0:
            return False
    return True

for i in range(x, 200000):
    if check(i) == True:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
res = int(a*b / math.gcd(a, b))
print(res)

Fixed submission:
import fractions as fr
a, b = map(int, input().split())
res = int(a*b / fr.gcd(a, b))
print(res)

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.gcd(a, b))

Fixed submission:
import fractions as fr
a, b = map(int, input().split())
res = int(a*b / fr.gcd(a, b))
print(res)
Buggy python submission (verdict: Runtime Error):
a1, a2, a3 = map(int, input(), split())
if a1+a2+a3 <= 21:
    print("win")
else:
    print("bust")

Fixed submission:
a1, a2, a3 = map(int, input().split())
if a1+a2+a3 <= 21:
    print("win")
else:
    print("bust")
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(1 / round(a/2))

Fixed submission:
a = int(input())
print(int((a+1) / 2) / a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i + 1
print(" ".join(mao(str, ans)))

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

ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i + 1
print(" ".join(map(str, ans)))

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

for i in range(n):
    print(str(a.index(i+1) + 1), end=" ")

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

ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i + 1
print(" ".join(map(str, ans)))

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] = str(a.index(i+1) + 1)
print(" ".join(s))

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

ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i + 1
print(" ".join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
if input() == "Sunny":
    print("Cloudy")
elif input() == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Fixed submission:
S = str(input())
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
S, T = map(str, input().split())
list_S = list(S)
list_T = list(T)
count = 0
for i in range(3):
    if list_S[i] == list_T[i]:
        count += 1
print(count)

Fixed submission:
S = list(input())
T = list(input())

count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
S, T = map(str, input().split())
list_S = list(S)
list_T = list(T)
count = 0
for i in range(3):
    if list_S(i) == list_T(i):
        count += 1
print(count)

Fixed submission:
S = list(input())
T = list(input())

count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
S, T = map(str, input().split())
list_S = list(S)
list_T = list(T)
count = 0
for i in 3:
    if list_S(i) == list_T(i):
        count += 1
print(count)

Fixed submission:
S = list(input())
T = list(input())

count = 0
for i in range(3):
    if S[i] == T[i]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if 1 <= n <= 9:
    print(n)
elif 10 <= n <= 99:
    print(9)
elif 100 <= n <= 999:
    print(n-100+10)
elif 1000 <= n <= 9999:
    print(909)
elif 10000 <= n <= 99999:
    print(i-10000+910)
else:
    print(90909)

Fixed submission:
n = int(input())
if 1 <= n <= 9:
    print(n)
elif 10 <= n <= 99:
    print(9)
elif 100 <= n <= 999:
    print(n-100+10)
elif 1000 <= n <= 9999:
    print(909)
elif 10000 <= n <= 99999:
    print(n-10000+910)
else:
    print(90909)
Buggy python submission (verdict: Runtime Error):
P, Q, R = map(int, input().split())
time = [P+Q, P+R, Q+R]
print(min(time))

Fixed submission:
A, P = map(int, input().split())
print(int((A*3 + P)/2))
Buggy python submission (verdict: Runtime Error):
s = input()

res = []

for i in range(len(s)):
    for j in range(i, len(s)):
        check = s[i:j+1]
        if len(check) == check.count("A")+check.count("T")+check.count("C")+check.count("G"):
            res.append(len(check))
print(max(res))

Fixed submission:
s = input()

res = []

for i in range(len(s)):
    for j in range(i, len(s)):
        check = s[i:j+1]
        if len(check) == check.count("A")+check.count("T")+check.count("C")+check.count("G"):
            res.append(len(check))
print(0 if res == [] else max(res))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H*W - (h*W + H*w - h*w)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h) * (W-w))
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(n)]

cost = []

for i in range(n):
    if c_t[i][1] <= t:
        cost.append(c_t[i][0])
print(min(cost))

Fixed submission:
n, t = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(n)]

cost = []

for i in range(n):
    if c_t[i][1] <= t:
        cost.append(c_t[i][0])
if len(cost) == 0:
    print("TLE")
else:
    print(min(cost))
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for _ in range(h)]

row = [False] * h
col = [False] * w
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            row[i] = True
            col[i] = True
for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j], end = "")
        print()

Fixed submission:
h, w = map(int, input().split())
a = [input() for _ in range(h)]

row = [False] * h
col = [False] * w
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            row[i] = True
            col[j] = True
for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j], end = "")
        print()
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
if n // k % 0:
    print("0")
else:
    print("1")

Fixed submission:
n, k = map(int, input().split())
if n % k == 0:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if abs(c-a) <= d or (abs(c-b) <= d and abs(b-a) <=d:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(c-a) <= d or (abs(c-b) <= d and abs(b-a) <=d):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if b-a <= d or c-b <= d:
    print(Yes)
else:
    print("No")

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(c-a) <= d or (abs(c-b) <= d and abs(b-a) <=d):
    print("Yes")
else:
    print("No")