Harryxun/stf_run huggingface dataset:
n=int(input())
ans=len(str(n))
for i in range(1, int(n**0.5)+1):
    if n % i != 0:
        continue
    a=i
    if i != n // i:
        b=n//i
    ans=min(ans,len(str(max(a,b))))
print(ans)

### FIXED CODE ###

n=int(input())
ans=len(str(n))
for i in range(1, int(n**0.5)+1):
    if n % i != 0:
        continue
    a=i
    b=i
    if i != n // i:
        b=n//i
    ans=min(ans,len(str(max(a,b))))
print(ans)
a=input()
if a=A:
 print(T)
elif a=T:
 print(A)
elif a=C:
 print(G) 
else:
 print(C)

### FIXED CODE ###

a=input()
if a=="A":
 print("T")
elif a=="T":
 print("A")
elif a=="C":
 print("G") 
else:
 print("C")
from math import factorial
n = int(input())
l = list(map(int, input().split()))
l.sort()
disabled = 0
for i in range(n-2):
    for j in range(i+1,n-1):
            for k in range(j+1,n):
                if (l[i] + l[j]) <= l[k] or l[i] == l[j] or l[j] == l[k]:
                    disabled += 1
print(int(factorial(n) / factorial(3) / factorial(n-3) - disabled))

### FIXED CODE ###

from math import factorial
n = int(input())
l = list(map(int, input().split()))
l.sort()
disabled = 0
for i in range(n-2):
    for j in range(i+1,n-1):
            for k in range(j+1,n):
                if (l[i] + l[j]) <= l[k] or l[i] == l[j] or l[j] == l[k]:
                    disabled += 1
if n >= 3:
    print(int(factorial(n) / factorial(3) / factorial(n-3) - disabled))
else:
    print("0")
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(H: int, W: int, A: "List[str]"):
    holes = [[float('inf')] * W for _ in range(H)]
    for i,l in enumerate(A):
        for j, c in enumerate(l):
            if c == '#':
                holes[i][j] = 0
    for i in range(H):
        for j in range(1, W):
            holes[i][j] = min(holes[i][j], holes[i][j-1] + 1)
        for j in range(W - 2, -1, -1):
            holes[i][j] = min(holes[i][j], holes[i][j+1] + 1)

    for i in range(1, H):
        for j in range(W):
            holes[i][j] = min(holes[i][j], holes[i-1][j] + 1)
    for i in range(H - 2, -1, -1):
        for j in range(W):
            holes[i][j] = min(holes[i][j], holes[i+1][j] + 1)

    ret = -float('inf')
    for l in holes:
        ret = max(ret, max(l))
    return ret


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [ next(tokens) for _ in range(W) ]  # type: "List[str]"
    result = solve(H, W, A)
    if isinstance(result, Iterable):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *


def solve(H: int, W: int, A: "List[str]"):
    queue = deque()

    rem = H * W
    visited = [True] * ((W+2) * (H+2))
    for i in range(W+2):
        visited[i] = False
        visited[(W + 2) * (H + 1) + i] = False
    for i in range(H+2):
        visited[(W + 2) * i] = False
        visited[(W + 2) * i + (W + 1)] = False

    for i in range(H):
        l = A[i]
        for j in range(W):
            if l[j] == '#':
                queue.append((i+1, j+1, 0))
                k = i * (W + 2) + j
                visited[k] = False

    ret = 0
    while queue:
        i, j, n = queue.popleft()
        k = i * (W + 2) + j
        if not visited[k] and 0 < n:
            continue
        visited[k] = False
        ret = n
        rem -= 1

        if rem == 0:
            break

        if visited[k - 1]:
            queue.append((i, j - 1, n + 1))
        if visited[k + 1]:
            queue.append((i, j + 1, n + 1))

        if visited[k - (W + 2)]:
            queue.append((i - 1, j, n + 1))
        if visited[k + (W + 2)]:
            queue.append((i + 1, j, n + 1))
    return ret


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [ next(tokens) for _ in range(H) ]  # type: "List[str]"
    result = solve(H, W, A)
    print(result)

if __name__ == '__main__':
    main()
l,n=map(int,input().split())
D=[]
for _ in range(n):
    D.append(str(input()))

S=sorted(D,reverse=False)
m=" "
for i in S:
    m+=i

print(m)

### FIXED CODE ###

n,l=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())
 
list.sort()
ans=""
for i in list:
    ans+=i
print(ans)
N = int(input())
s = [input() for i in range(N)]

n = N
max_num = 0
t = []
while n >= max_num:
    word = s[0]
	count = 0
    for i in s:
      if i == word:
        count += 1
        
    if count > max_num:
      max_num = count
      t = [s[0]]
    elif count == max_num:
      t = t.append(s[0])
      
    s = [i for i in s if i != word]
    n = len(s)

t = sorted(t)
for i in range(t):
  print(i)

### FIXED CODE ###

import collections

N = int(input())
s = [input() for i in range(N)]

c = collections.Counter(s)
max_num = max(c.values())
d = []
for key,value in c.items():
  if value == max_num:
    d.append(key)

for i in sorted(d):
  print(i)
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

#??\?????????????????????????????§????????????????????????????????????
n = int(input())
for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v
 
for b in range(4):
    for f in range(3):
        for r in range(10):
         
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

count = int(input())
for c in range(count):
    b, f, r, v = [int(i) for i in input().split()]
    data[b-1][f-1][r-1] += v


for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)
n = int(input())
sp = [input().split() for i in range(n)]

sorted_sp = sorted(sp,key = lambda x: int(x[1]), reverse=True)
sorted_sp = sorted(sorted_sp,key = itemgetter(0))

for i in range(n):
    for j in range(n):
        if sp[j] == sorted_sp[i]:
            print(j+1)

### FIXED CODE ###

from operator import itemgetter

n = int(input())
sp = [input().split() for i in range(n)]

sorted_sp = sorted(sp,key = lambda x: int(x[1]), reverse=True)
sorted_sp = sorted(sorted_sp,key = itemgetter(0))

for i in range(n):
    for j in range(n):
        if sp[j] == sorted_sp[i]:
            print(j+1)
n, m = map(int, input().split())

result = [[0] * 2 for i in range(n)]

for _ in range(m):
    tmp_i, s = input().split()
    i = int(tmp_i)
    if result[i][0] == 1:
        continue
    if s == 'AC':
        result[i][0] += 1
    else:
        result[i][1] += 1

print(sum([result[i][0] for i in range(n)]),
      sum([result[i][1] for i in range(n)]))


### FIXED CODE ###

n, m = map(int, input().split())

ac = [0] * n
wa = [0] * n
wa_total = 0
for _ in range(m):
    tmp_i, s = input().split()
    i = int(tmp_i) - 1
    if ac[i] == 1:
        continue
    if s == 'AC':
        ac[i] = 1
        wa_total += wa[i]
    else:
        wa[i] += 1

print(sum(ac), wa_total)
a, b, c = sorted(map(int, input().split()), reverse=True)
k = int(intput())
print(a*2**k + b + c)


### FIXED CODE ###

a, b = map(int, input().split())
print(a if a <= b else a - 1)
a,b,c =[input(i) for i in input().split()]


total = 0
for d in range(a,b + 1):
    if c % d == 0:
        total += 1

print(total)

### FIXED CODE ###

a,b,c = [int(i) for i in input().split()]


total = 0
for d in range(a,b + 1):
    if c % d == 0:
        total += 1

print(total)
import sympy
a = 0
n = int(input())
for i in range(1,n+1):
    a += i*(sympy.divisor_count(i))
print(a)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1):
    a = n//i
    ans += i*(a*(a+1)//2)
print(ans)
N = int(input())
 
p = list()
 
p = map(int, input().split())
 
k = 0
 
for i in range(0, len(p)-1 ):
  if (p[i] > p[ i + 1 ]):
    k += 1
    
    
if ( k <= 1 ):
  print("YES")
else:
  print("NO")
  

### FIXED CODE ###

N=int(input())
num = list(map(int,input().split()))

num_sort = sorted(num)
ans = 0

for i in range(N):
  if num[i] == num_sort[i]:
    continue
  else:
    ans += 1
    
if ans <= 2:
  print("YES")
else:
  print("NO")
print x ^ 3

### FIXED CODE ###

x = input()
cube = x * x * x
print cube
N = int(input())
Mylist = list(input())
ANSlist = []
if N%2 == 1:
  print("No")
else: 
    for i in range(N/2):
        if Mylist[i] == Mylist[i + N/2]:
        ANSlist.append("Yes")
    if len(ANSlist) == N/2:
        print("Yes")

### FIXED CODE ###

r = int(input())
print(r**2)
list = [input() for i in range 2]
if list[1] == list[2][:-1]:
  print("Yes")
  else:
    print("No")

### FIXED CODE ###

list = [input() for i in range (2)]
if list[0] == list[1][:-1]:
  print("Yes")
else:
    print("No")
import collections
def factorization(n):
    if n<2:
        return []
    
    prime_factor=[]
    
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            prime_factor.append(i)
            n//=i
            
    if n>1:
        prime_factor.append(n)

        
    return prime_factor

n=int(input())

c=collections.Counter(factorization(n))
d=list(c.values())

for v in c.values():
    for i in range(1,n):
        v-=i
        if v>=0:
            count+=1
        else:
            break
print(count)

### FIXED CODE ###

import collections
def factorization(n):
    if n<2:
        return []
    
    prime_factor=[]
    
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            prime_factor.append(i)
            n//=i
            
    if n>1:
        prime_factor.append(n)
    return prime_factor

count=0
n=int(input())
 
c=collections.Counter(factorization(n))
d=list(c.values())
 
for v in c.values():
    for i in range(1,n):
        v-=i
        if v>=0:
            count+=1
        else:
            break
print(count)
S=input()
K=int(input())
if K<=len(S):
    for s in S[:K]:
        if s!="1":
            break
    else:
        print("1")
else:
	for s in S:
    	if s!="1" :
        	print(s)
        	break

### FIXED CODE ###

S=input()
K=int(input())
f=0
if(K<=len(S)):
    for s in S[:K]:
        if s!="1":
            break
    else:
        print("1")
        f=1
if f==0:      
    for s in S:
        if(s!="1"):
            print(s)
            break
N, K, X, Y=[int(input()) for i in range(4)]
if N=<K:
  print(K*X)
else:
  print(K*X+Y*(N-K))

### FIXED CODE ###

N, K, X, Y=[int(input()) for i in range(4)]
if N<=K:
  print(N*X)
else:
  print(K*X+Y*(N-K))
_N, _K, _Q = input().split()
N, K, Q = int(_N), int(_K), int(_Q)
A = []
for i in range(Q):
  A.append(int(input()))

if K > Q:
  for i in range(N):
    print("Yes")
else:
  hoge = Q - K + 1
  goods = sorted(set([i for i in A if A.count(i) >= hoge]))
  j = 0
  max_j = len(goods)
  for i in range(1,N+1):
    if i == goods[j]:
      print("Yes")
      if j + 1 == len(goods):
        for k in range(i,N):
          print("No")
        break
      else:
        j += 1
    else:
      print("No")

### FIXED CODE ###

import numpy as np
_N, _K, _Q = input().split()
N, K, Q = int(_N), int(_K), int(_Q)
A = []
for i in range(Q):
  A.append(int(input()))

if K > Q:
  for i in range(N):
    print("Yes")
else:
  score = K * np.ones(N) - Q
  for i in A:
    score[i-1] += 1
  for i in score:
    if i > 0:
      print("Yes")
    else:
      print("No")
import numpy as np
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
xy = [list(map(int,input().split())) for _ in range(m)]
# dp[j][k]:頂点iからはじまり頂点jで終わる最長のもの
dp=np.full((n,n),-1,np.int64)
for i in range(n):
      dp[i][i]=0
for _ in xy:
      x_=_[0]-1
      y_=_[1]-1
      dp[x_,y_]=1
      x0=np.where(dp[:,x_] >= 0)[0]
      y0=np.where(dp[y_,:] >= 0)[0]
      for j in x0:
            for k in y0:
                  dp[j,k]=max(dp[j,k],dp[j,x_]+dp[y_,k]+1)
print(np.max(dp))

### FIXED CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
n,m = map(int,input().split())
g=[[] for _ in range(n)]
for _ in range(m):
      x,y=map(int,input().split())
      g[x-1].append(y-1)
memo = [0]*n
visited = [False]*n
# dp(i):i=0,1,..,n-1:頂点iを始点とした最長のパスを返す
def dp(v):
      if visited[v]:
            return memo[v]
      else:
            res=0
            for u in g[v]:
                  res=max(res,dp(u)+1)
            memo[v]=res
            visited[v]=True
            return res
for i in range(n):
      dp(i)
print(max(memo))
A,B,K =map(int,input().split())
for i in range(A,B+1):
    if i < (A + K) :
        print(i)
    elif i > (B - K):
        print(i)

### FIXED CODE ###

S = input().replace("a","",1).replace("b","",1).replace("c","",1)
if S:
    print("No")
else:
    print("Yes")
N = int(input())
S = list(str(input()))
K = int(input())

SK = str(S[K])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
print(S, end="")

### FIXED CODE ###

x = input().split()
A = int(x[0])
B = int(x[1])
C = int(x[2])

if A < B:
    if C in range(A, B):
        print("Yes")
    else:
        print("No")
else:
    if C in range(B, A):
        print("Yes")
    else:
        print("No")
S=int(input())
T=int(input())
count=0;
for i in range(0,len(S)):
    if (T[i]!=S[i]):
        count+=1
print(count)

### FIXED CODE ###

S=input()
T=input()
count=0;
for i in range(0,len(S)):
    if (T[i]!=S[i]):
        count+=1
print(count)
xn=input()
p=input()
x,n=xn.split()
if p=='':
  print(int(x))
else:
  p={int(i) for i in p.split()}
  s={i for i in range(1,100)}
  s_p=list(s-p)
  d=[abs(i-int(x)) for i in s_p]
  print(s_p[d.index(min(d))])

### FIXED CODE ###

xn=input()
x,n=xn.split()
if n=='0':
  print(int(x))
else:
  p=input()
  p={int(i) for i in p.split()}
  s={i for i in range(-150,150)}
  s_p=list(s-p)
  d=[abs(i-int(x)) for i in s_p]
  print(s_p[d.index(min(d))])
s = list(input())
n = len(s)
t = s + s
k = int(input())
tmp1 = 0
for i in range(n * 2 - 2):
    if t[i] == t[i + 1]:
        tmp1 += 1
        t[i + 1] = 'X'
if t[-1] == t[-2]:
    tmp1 += 1
tmp2 = 0
for i in range(n - 2):
    if s[i] == s[i + 1]:
        tmp2 += 1
        s[i + 1] = 'X'
if s[-1] == s[-2]:
    tmp2 += 1
tmp3 = tmp1 - tmp2 * 2
print(tmp3 * (k - 1) + tmp2 * k)

### FIXED CODE ###

s = list(input())
n = len(s)
k = int(input())
flg = 1
for i in range(n - 1):
    if s[i] != s[i + 1]:
        flg = 0
if flg:
    print(n * k // 2)
    exit(0)
t = s + s
tmp1 = 0
for i in range(n * 2 - 1):
    if t[i] == t[i + 1]:
        tmp1 += 1
        t[i + 1] = 'X'
tmp2 = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        tmp2 += 1
        s[i + 1] = 'X'
tmp3 = tmp1 - tmp2 * 2
print(tmp3 * (k - 1) + tmp2 * k)
n=int(input())
ans=0
for i in range(18):
  ans+=int(n/(10**(i+1))*(i+1)
print(ans)


### FIXED CODE ###

#E
import math
n = int(input())
ans = 0
i = 1
if n % 2 == 0:
    tmp = 5 ** i * 2
    while tmp <= n:
        tmp = 5 ** i * 2
        ans += n //tmp
        i += 1
    print(ans)
else:
    print(0)
A = input()
print(A ** 2)

### FIXED CODE ###

A = int(input())
print(A ** 2)
a, b = map(int, input().split())

a=int(0)
x=max([a, b])
y=min([a, b])

if x+y % 3 ==0 and x < y*2:
    a=int(1)

n=(x+y)/3
r=(x-y)/2
n2=int(1)
r2=int(1)
r3=int(1)
for i in range(n):
    n2=n2*(i+1)
for i in range(r):
    r2=r2*(i+1)
for i in range(n-r):
    r3=r3*(i+1)
ans=(n2/r2/r3)//(10**9+7)

if a==1:
    print(ans)
else:
    print(a)


### FIXED CODE ###


a, b = map(int, input().split())

aa=int(0)
x=max([a, b])
y=min([a, b])

if (x+y)%3 ==0 and x <= y*2:
    aa=int(1)

n=int((x+y)/3)
k=int((n-(x-y))/2)


def comb(n, k, mod=10**9+7):
    numer = denom = 1
    for i in range(k):
        numer = (numer * (n-i)) % mod
        denom = (denom * (i+1)) % mod
    return (numer * pow(denom, mod-2, mod)) % mod

if aa==1:
    print(comb(n,k))
else:
    print(aa)
import numpy as np
N, K = map(int, input().split())
M = 10**9+7
xs = []
for _ in range(N):
    xs.append(list(map(int, input().split())))
X = np.array(xs, dtype="int64")
S = np.ones(N, dtype="int64")
#Xs = [X]
for _ in range(60):
#    Xs.append(np.dot(Xs[-1],Xs[-1])%M)
    if K%2:
        S = np.dot(X, S)%M
    K = K//2
    X = np.dot(X, X)%M
r = 0
for s in S:
    r = (r + s)%M
print(r)


### FIXED CODE ###

import numpy as np
N, K = map(int, input().split())
M = 10**9+7
xs = []
for _ in range(N):
    xs.append(list(map(int, input().split())))
X = np.array(xs, dtype="object")
S = np.ones(N, dtype="object")
#Xs = [X]
for _ in range(60):
#    Xs.append(np.dot(Xs[-1],Xs[-1])%M)
    if K%2:
        S = np.dot(X, S)%M
    K = K//2
    X = np.dot(X, X)%M
S = np.array(S, dtype="int64")
r = 0
for s in S:
    r = (r + s)%M
print(r)
D, M=map(int, input().split())
print((100**D)*N)

### FIXED CODE ###

D, N=map(int, input().split())
a=0
if N==100:
  a=100**D
print((100**D)*N+a)
a=set(map(int,input().split()))
if len(set)==2:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

s = set(map(int, input().split()))
if len(s) == 2:
    print("Yes")
else:
    print("No")
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*calc[i]
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)


### FIXED CODE ###

n=int(input())
a=input().split()
a=list(map(int,a))
ans=1
if(0 in a):
    print(0)
    exit()

for calc in a:
    ans*=calc
    if(ans>10**18):
        print(-1)
        exit()
if(ans>10**18):
    print(-1)
else:
    print(ans)
L,M=map(int,input().split())
import numpy as np
a=np.zeros((L,M))
count=0
for i in range(L):
    for j in range(M):
        if L>=3 and M>=3:
            if i>=1 and i<=L-2 and j>=1 and j<=M-2:
                count+=1
                continue
        syuui=0
        a=[[i-1,j-1],[i-1,j],[i-1,j+1],[i,j-1],[i,j],[i,j+1],[i+1,j-1],[i+1,j],[i+1,j+1]]
        for k in a:
            if 0<=k[0] and k[0]<L and k[1]>=0 and k[1]<M:
                syuui+=1
        if syuui%2==1:
            count+=1
print(count)

### FIXED CODE ###

L,M=map(int,input().split())
count=0
if L==1 and M==1:
    print(1)
elif L==1 or M==1:
    print(L+M-3)
if L==2 or M==2:
    print(0)
if L>=3 and M>=3:
    print((L-2)*(M-2))
N = int(input())
S = int(input())
if N % 2 != 0:
    print("No")
else:
    arr = list(S)
    s_len = len(arr) // 2
    if arr[s_len:] == arr[:s_len]:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N = int(input())
S = input()
if N % 2 != 0:
    print("No")
else:
    arr = list(S)
    s_len = len(arr) // 2
    if arr[s_len:] == arr[:s_len]:
        print("Yes")
    else:
        print("No")
// inputに入力データ全体が入る
function Main(input) {
	var line = input.split("\n");
	var N = Number(line[0]);
	var X = line[1].split(" ");

	var Y = X.slice().sort(function(a, b){
		return Number(a) - Number(b)
	});

	var median = [Number(Y[(N/2 - 1)]), Number(Y[N/2])];
	var ret = [];

	for(var i = 0; i < X.length; i++){
		if(median[1] <= Number(X[i])){
			console.log(median[0] + "\n");
		}else{
			console.log(median[1] + "\n");
		}
	}
	return 0;

}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


### FIXED CODE ###

import copy

def main():
	N = int(input())
	X = [int(x) for x in input().split(" ")]
	sortedX = copy.deepcopy(X)
	sortedX.sort()
	cand = [sortedX[int(N / 2) - 1], sortedX[int(N / 2)]]

	for xi in X:
		if xi <= cand[0]:
			print(cand[1])
		else:
			print(cand[0])

main()
N,A,B = map(int, input().split())
if (B-A)%2 == 0 and B-A => 0:
  print((B-A)//2+1)
if (B-A)%2 == 0 and A-B => 0:
  print((A-B)//2+1)
D = A-1
E = N-A
F = B-1
G = N-B
elif D+F > E+G and D => F:
  print(D)
elif D+F > E+G and D <= F:
  print(F)
elif D+F < E+G and E => G:
  print(E)
else:
  print(G)


### FIXED CODE ###

N,A,B = map(int, input().split())
if (B-A)%2==0:
  print((B-A)//2)
else:
  print(min(A-1,N-B)+1+(B-A-1)//2)
s = input()

i = 0
while i < len(s):
    if(s[i] == 'h' and s[i+1] == 'i'):
        ans = "Yes"
    else:
        ans = "No"
        break
    i += 2

print(ans)

### FIXED CODE ###

s = input()

i = 0

if(len(s) % 2 != 0):
    ans = "No"
else:
    while i < len(s):
        if(s[i] == 'h' and s[i+1] == 'i'):
            ans = "Yes"
        else:
            ans = "No"
            break
        i += 2

print(ans)
import math

def overlap(p1, p2, d):
    return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 <= d

def intersection(o1,o2):
    a  = 2*(o2[0] - o1[0])
    b  = 2*(o2[1] - o1[1])
    c  = (o1[0] - o2[0])*(o1[0] + o2[0]) + (o1[1] - o2[1])*(o1[1] + o2[1])
    a2 = a**2 + b**2
    b2 = a*c + a*b*o1[1] - b**2*o1[0]
    c2 = b**2*(o1[0]**2 + o1[1]**2 - 1) + c**2 + 2*b*c*o1[1]
    x1 = (-b2 + math.sqrt(b2**2 - a2*c2))/a2
    x2 = (-b2 - math.sqrt(b2**2 - a2*c2))/a2
    if b == 0:
        y1 = (o1[1] + o2[1])/2
        y2 = (o1[1] + o2[1])/2
    else:
        y1 = -(a*x1 + c)/b
        y2 = -(a*x2 + c)/b
    if b2**2 - a2*c2 < 10e-6:
        return [x1, y1], [None, None]
    else:
        return [x1, y1], [x2, y2]

while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            if not overlap(p[i], p[j], 4):
                continue
            elif overlap(p[i], p[j], 10e-6):
                continue
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if overlap(p1, p[k], 1):
                    cnt1 += 1
                if p2[0] != None and overlap(p2, p[k], 1):
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)



### FIXED CODE ###

import math

def dist(p1, p2):
    return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)

def intersection(o1,o2):
    if dist(o1,o2) > 2:
        p1, p2 =  [None, None], [None, None]
    elif dist(o1,o2) == 2:
        p1, p2 =  [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2], [None, None]
    else:
        m = [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2]
        v = [m[0] - o1[0], m[1] - o1[1]]
        v_abs = dist(v,[0,0])
        w = [v[1], -v[0]]
        w_abs = dist(w,[0,0])
        n = [w[0]/w_abs, w[1]/w_abs]
        l = math.sqrt(1 - v_abs**2)
        p1 = [m[0] + l*n[0], m[1] + l*n[1]]
        p2 = [m[0] - l*n[0], m[1] - l*n[1]]
    return p1, p2
err = 1.0e-6
while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 1
    for i in range(n - 1):
        for j in range(i + 1, n):
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if p1[0] and dist(p1, p[k]) <= 1 + err:
                    cnt1 += 1
                if p2[0] and dist(p2, p[k]) <= 1 + err:
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)
N, T = map(int, input().split())

c = [0 for i in range(N)]
t = [0 for i in range(N)]

count = 0

for i in range(N):
    c[i], t[i] = map(int, input().split())
    
for i in range(N):
    if t[i] > T:
        del c[i]
        count += 1
        
c.sort()

if count != N:
    print(c[0])
else:
    print("TLE")

### FIXED CODE ###

N, T = list(map(int, input().split()))

ans = 10**9

for i in range(N):
    c, t = list(map(int, input().split()))
    if t <= T:
        if c < ans:
            ans = c

if ans == 10**9:
    print('TLE')
else:
    print(ans)