main=do
 [n,t]<-map read.words<$>getLine
 s<-map(map read.words).lines<$>getContents
 let c=f 2000 t s
 putStr$if c<2000 then show c else"TLE"
f c t[]=c
f c t([a,z]:x)=f(if t<z then c else min a c)t x
