import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.*;
class Main
{
    public static void main(String[] args)throws IOException
    {
        FastReader in=new FastReader(System.in);
        StringBuffer st=new StringBuffer();
       int n=in.nextInt();
       int t=in.nextInt();
       int ans=1000000,d=t;
       while(n--!=0){
         int a=in.nextInt();
         int b=in.nextInt();
         if(b<=t){
          if(a<ans){
            ans=a;
          }
         }
       }
          if(ans==1000000)
        System.out.println("TLE");
        else
        System.out.println(ans);
    }
    static class FastReader{

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan());
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }

        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
}


import java.util.*;
import java.io.*;

public class Main{

	public static void main(String[] args) throws IOException {
		int N = readInt(), T = readInt();
		int min = Integer.MAX_VALUE;
		for(int i = 1; i<=N; i++) {
			int c = readInt(), t = readInt();
			if(t <= T) min  = Math.min(min, c);
		}
		println(min == Integer.MAX_VALUE ? "TLE" : min);
		exit();
	}

	final private static int BUFFER_SIZE = 1 << 16;
	private static DataInputStream din = new DataInputStream(System.in);
	private static byte[] buffer = new byte[BUFFER_SIZE];
	private static int bufferPointer = 0, bytesRead = 0;
	static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

	public static String readLine() throws IOException {
		byte[] buf = new byte[64]; // line length
		int cnt = 0, c;
		while ((c = Read()) != -1) {
			if (c == '\n')
				break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	public static String read() throws IOException {
		byte[] ret = new byte[1024];
		int idx = 0;
		byte c = Read();
		while (c <= ' ') {
			c = Read();
		}
		do {
			ret[idx++] = c;
			c = Read();
		} while (c != -1 && c != ' ' && c != '\n' && c != '\r');
		return new String(ret, 0, idx);
	}

	public static int readInt() throws IOException {
		int ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (neg)
			return -ret;
		return ret;
	}

	public static long readLong() throws IOException {
		long ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');
		if (neg)
			return -ret;
		return ret;
	}

	public static double readDouble() throws IOException {
		double ret = 0, div = 1;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();

		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (c == '.') {
			while ((c = Read()) >= '0' && c <= '9') {
				ret += (c - '0') / (div *= 10);
			}
		}

		if (neg)
			return -ret;
		return ret;
	}

	private static void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
		if (bytesRead == -1)
			buffer[0] = -1;
	}

	private static byte Read() throws IOException {
		if (bufferPointer == bytesRead)
			fillBuffer();
		return buffer[bufferPointer++];
	}

	static void print(Object o) {
		pr.print(o);
	}

	static void println(Object o) {
		pr.println(o);
	}

	static void flush() {
		pr.flush();
	}

	static void println() {
		pr.println();
	}

	static void exit() throws IOException {
		din.close();
		pr.close();
		System.exit(0);
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	static FastScanner sc;
	static PrintWriter out;
	public static void main(String[] args){
		sc = new FastScanner();
		out = new PrintWriter(System.out);
		out.println(solve());
		out.flush();
	}

	static String solve(){
		int N = sc.nextInt();
		int T = sc.nextInt();
		int minCost = Integer.MAX_VALUE;
		int tmpCost;
		for(int i=0;i<N;i++){
			tmpCost = sc.nextInt();
			if(sc.nextInt()<=T && minCost > tmpCost){
				minCost = tmpCost;
			}
		}
		return (minCost == Integer.MAX_VALUE)? "TLE":String.valueOf(minCost);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) nl;
	}
	public double nextDouble() { return Double.parseDouble(next());}
}


import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int N = one.get(0);
		int T = one.get(1);
		TreeSet<Integer> set = new TreeSet<Integer>();
		for(int i = 0; i < N; i++){
			ArrayList<Integer> tmp = nextIntArray();
			if(tmp.get(1) <= T){
				set.add(tmp.get(0));
			}
		}
		myout(set.first());
	}
	//Method addition frame start

	//Method addition frame end
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int T = sc.nextInt();
        int[] c = new int[n];
        int[] t = new int[n];
        int min = Integer.MAX_VALUE;
        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            c[i] = sc.nextInt();
            t[i] = sc.nextInt();
            if(T >= t[i]) {
                if(min > c[i]) {
                    min = t[i];
                    ans = c[i];
                }
            }
        }
        if(ans == Integer.MAX_VALUE) System.out.println("TLE");
        else System.out.println(ans);
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int T = sc.nextInt();
        int[] c = new int[n];
        int[] t = new int[n];
        int min = Integer.MAX_VALUE;
        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            c[i] = sc.nextInt();
            t[i] = sc.nextInt();
            if(T > t[i]) {
                if(min > c[i]) {
                    min = t[i];
                    ans = c[i];
                }
            }
        }
        if(ans == Integer.MAX_VALUE) System.out.println("TLE");
        else System.out.println(ans);
    }
}


# include <iostream>
using namespace std;

int main()
{
    int min_cost = 1001;
    int N, T;
    int ct[1100][2];

    cin >> N >> T;
    for (int i = 0; i < N; ++i) cin >> ct[i][0] >> ct[i][1];

    for (int j = 0; j < N; ++j) {
        if (ct[j][1] <= T )
            if (min_cost > ct[j][0])
                min_cost = ct[j][0];
    }

    if (min_cost == 1001) cout << "TLE";
    else cout << min_cost;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
int N,T;
  cin>>N>>T;
 vector<int>c(N),t(N);
   for(int i=0; i<N; i++){
  cin>>c[i]>>t[i];
   }
  vector<int>filtered_c;
  for(int i=0; i<N; i++){
  if(T>=t[i]){
    filtered_c.push_back(c[i]);
  }
  }
  if(filtered_c.size()==0){
  cout<<"TLE"<<endl;
  }
  else{
  cout<<*min_element(filtered_c.begin(), filtered_c.end())<<endl;
  }
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	int n, t;
	scanf("%d%d", &n, &t);
	int maxi = (-1) ^ (1 << 31);
	for (int i = 0; i < n; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		if (b <= t) maxi = min(maxi, a);
	}
	if (maxi == ((-1) ^ (1 << 31))) printf("TLE\n");
	else printf("%d\n", maxi);
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pf(n) printf("%d\n",n)
#define pff(a,b) printf("%d  %d\n",a,b);
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1001001001;
const double PI = acos(-1);

int main() {
	int n, T;
	cin >> n >> T;
	int ans = 1001001;
	rep(i, n) {
		int c, t;
		cin >> c >> t;
		if (t <= T and c<ans) {
			ans = c;
		}
	}
	cout << ans << endl;

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
  int n,T;
  cin>>n>>T;
  int count=0;
  int a=0;
  for(int i=0;i<n;i++){
    int c,t;
    cin>>c>>t;
    if(t>T){
      count++;
    }
    else{
      if(a>c){
        a=c;
      }
    }
  }
  if(count==n){
    cout<<"TLE";
  }
  else{
    cout<<a;
  }
}


#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

using vi = vector<int>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define show(x) cout << #x << " = " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo {cout<<"Yes";}else{cout<<"No";}
#define YESNO {cout<<"YES";}else{cout<<"NO";}
#define v(T) vector<T>

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

#if 1

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N, T;
  cin >> N >> T;
  int mc = INT32_MAX;
  F0R(i, N) {
    int c, t;
    cin >> c >> t;
    if (t <= T) chmin(mc, c);
  }
  cout << mc;
}
#endif


#include<stdio.h>
int main(){
  int n,i,time,min=1001;
  scanf("%d%d",&n,&time);
  int route[n+1][2];
  for(i=0;i<n;i++){
    scanf("%d%d",&route[i][0],&route[i][1]);
    if(route[i][1]<=time && route[i][0]<min)
      min=route[i][0];
  }
  if(min==1001){
    printf("TLE\n");
    return 0;
  }
  printf("%d\n",min);
  return 0;
}


#include <stdio.h>

int main(void){
    int n,a;
    scanf("%d %d",&n,&a);
    int c[n];
    int t[a];
    int mincost = 1001;
    int mintime = 1001;
    for(int i = 0;i<n;i++){
        scanf("%d %d",&c[i],&t[i]);
        if(c[i] <= mincost && t[i] <= a){
            mincost = c[i];
            mintime = c[i];
        }
    }
    if(mincost == 1001){
        printf("TLE\n");
    }else{
        printf("%d\n",mincost);
    }
}


#include <stdio.h>

int main(void){
	int N,T;
	int c[100],t[100];
	int n = 0;
	int c_good = 1001;

	scanf("%d %d",&N,&T);

	while(scanf("%d %d",&c[n],&t[n]) != EOF){
		n++;
	}

	for(int i=0;i<=n;i++){
		if(T >= t[i] && t[i] >= 1 && t[i] <= 1000){
			if(c_good > c[i] && c[i] >= 1 && c[i] <= 1000){
				c_good = c[i];
			}
		}
	}

	if (c_good == 1001){
		printf("TLE\n");
	}else{
		printf("%d\n",c_good);
	}
	return 0;
}


#include<stdio.h>

int main(void) {
    int n, time_max, c[1000], t[1000], i, min = 1;
    scanf("%d %d", &n, &time_max);
    for (i = 0; i < n; i++) {
        scanf("%d %d", &c[i], &t[i]);
    }

    for (i = 0; i < n; i++) {
        if (c[min] > c[i]) {
            min = i;
        }
    }

    if (t[min] > time_max) {
        printf("TEL\n");
    }
    else {
        printf("%d", c[min]);
    }
    return 0;
}


#include <stdio.h>
int main(void){
    int N, T, i, cst = 9999, cnt = 0;
    int c[1000];
    int t[1000];

    scanf("%d %d", &N, &T);

    for(i = 0; i < N; i++){
        scanf("%d %d", &c[i], &t[i]);
    }

    for(i = 0; i < N; i++){
        if(T >= t[i] && c[i] <= cst){
            cst = c[i];
        }else{
            cnt = cnt + 1;
        }
    }

    if(cnt == N){
        printf("TLE\n");
    }else if(cnt < N){
        printf("%d\n", cst);
    }


#include <stdio.h>

int main(void)
{
        int N,T,i,s=0,index,min=1000;
        scanf("%d%d",&N,&T);
        int c[N],t[N];
        for(i=0;i<N;i++)
                scanf("%d%d",&c[i],&t[i]);

        for(i=0;i<N;i++){
                if(t[i]<=T && min>c[i]){
                        min=c[i]; s++;
                }
        }
        if(s!=0) printf("%d\n",min);
        else printf("TLE\n");
        return 0;
}


'use strict'

const main = (input) => {
    input = input.split('\n')
    let temp = input[0].split(' ').map(i => parseInt(i))
    const N = temp[0]
    const T = temp[1]
    temp = input.slice(1, N + 1)
    let minc = 10000
    let mint = 10000
    temp.forEach(t => {
        let temp = t.split(' ').map(i => parseInt(i))
        if(temp[1] <= T && temp[0] < minc){
            minc = temp[0]
            mint = temp[1]
        }
    })

    if(minc === 10000){
        console.log('TLE')
    }else{
        console.log(minc)
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function Main(input){
    limit=input.split("\n");
    eachlimit=limit[0].split(" ");
    N=Number(eachlimit[0]);
    T=Number(eachlimit[1]);
    var ans=1001;
    for(i=1;i<=N;i++){
        info=limit[i].split(" ");
        if(T>=info[1]){
            c=Number(info[0]);
            ans=Math.min(ans,c);
        }
    }
    if(ans==1001){
        console.log('TLE');
    } else{
        console.log(ans);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

const main = (input) => {
    input = input.split('\n')
    let temp = input[0].split(' ').map(i => parseInt(i))
    const N = temp[0]
    const T = temp[1]
    temp = input.slice(1, N + 1)
    temp = temp.filter(t => {
        return parseInt(t.split(' ')[1]) <= T
    })

    let minc = 10000
    let mint = 10000
    temp.forEach(t => {
        let temp = t.split(' ').map(i => parseInt(i))
        if(temp[0] < minc){
            minc = temp[0]
            mint = temp[1]
        }
    })

    if(minc === 10000){
        console.log('TLE')
    }else{
        console.log(minc)
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))


function Main(input){
    limit=input.split("\n");
    eachlimit=limit[0].split(" ");
    N=Number(eachlimit[0]);
    T=Number(eachlimit[1]);
    var ans=1001;
    for(i=1;i<=N;i++){
        info=limit[i].aplit(" ");
        if(T>=info[1]){
            c=Number(info[0]);
            ans=Math.min(ans,c);
        }
    }
    if(ans==1001){
        console.log('TLE');
    } else{
        console.log(ans);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input){
    limit=input.split("\n");
    eachlimit=limit[0].split(" ");
    N=Number(eachlimit[0]);
    T=Number(eachlimit[1]);
    var ans=1001;
    for(i=1;i<=N;i++){
        info=limit[i].aplit(" ");
        if(T>=info[1]){
            c=Number(info[0]);
            ans=Math.min(ans,c);
        }
    }
    if(ans==1001){
        concole.log('TLE');
    } else{
        concole.log(ans);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input){
    limit=input.split("\n");
    eachlimit=input[0].split(" ");
    N=Number(eachlimit[0]);
    T=Number(eachlimit[1]);
    var ans=1001;
    for(i=1;i<=N;i++){
        info=limit[i].aplit(" ");
        if(T>=info[1]){
            c=Number(info[0]);
            ans=Math.min(ans,c);
        }
    }
    if(ans==1001){
        concole.log('TLE');
    } else{
        concole.log(ans);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	N := getInt()
	T := getInt()

	minCost := pow(10, 5)
	for i := 0; i < N; i++ {
		c := getInt()
		t := getInt()

		if t <= T && c < minCost {
			minCost = c
		}
	}

	if minCost == pow(10, 5) {
		fmt.Println("TLE")
	} else {
		fmt.Println(minCost)
	}
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	N, T := nextInt(), nextInt()
	minC := 1001
	for i := 0; i < N; i++ {
		c, t := nextInt(), nextInt()
		if t <= T && c <= minC {
			minC = c
		}
	}
	if minC <= 1000 {
		fmt.Println(minC)
	} else {
		fmt.Println("TLE")
	}
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
)

type route struct {
	c, t int64
}

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	N, T := readInt(), readInt()
	routes := make([]route, N)
	for i := int64(0); i < N; i++ {
		routes[i] = route{readInt(), readInt()}
	}
	minroute := int64(INF)
	for i := int64(0); i < N; i++ {
		if routes[i].t > T {
			continue
		}
		if routes[i].c < minroute {
			minroute = routes[i].c
		}
	}
	if minroute == INF {
		fmt.Println("TLE")
	} else {
		fmt.Println(minroute)
	}
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


package main

import (
  "fmt"
  "sort"
)

func main() {
  var n, t int
  fmt.Scan(&n, &t)
  ct := make([][2]int, n)
  for i := 0; i < n; i++ {
    fmt.Scan(&ct[i][0], &ct[i][1])
  }
  sort.Slice(ct, func(i, j int) bool {return ct[i][0] <= ct[j][0]})
  for i := 0; i < n; i++ {
    if ct[i][1] <= t {
      fmt.Println(ct[i][0])
      return
    }
  }
  fmt.Println("TLE")

}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	N := getInt()
	T := getInt()

	minCost := pow(10, 5)
	for i := 0; i < N; i++ {
		c := getInt()
		t := getInt()

		if t <= T && c < minCost {
			minCost = c
		}
	}
	fmt.Println(minCost)
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import "fmt"

func main() {
	var N, T int
	fmt.Scan(&N, &T)

	var c, t int
	min := 9999
	for i := 0; i < N; i++ {
		fmt.Scan(&c, &t)
		if t <= T && c <= min {
			min = c
		}
	}

	if min != 9999 {
		fmt.Println(min)
	}
	fmt.Println("TLE")
}


n,t = gets.split.map(&:to_i)
arr = []
n.times do
  c,time = gets.split.map(&:to_i)
  if time <= t
    arr << [c,time]
  end
end
puts arr.empty? ? :TLE : arr.sort[0][0]


#n = gets.to_s.to_i
n,l = gets.to_s.split.map{|i|i.to_i}
cts = Array.new(n){ gets.to_s.split.map{|i|i.to_i} }

ans = 10 ** 18
cts.each_with_index do |ct,i|
  c = ct[0]
  t = ct[1]

  # p ct

  next if t > l

  ans = c if ans > c
end

puts ans != 10 ** 18 ? ans : "TLE"


# abc112 B
n, T = gets.split.map(&:to_i)
ct = n.times.map {
  gets.split.map(&:to_i)
}

puts ct.select{|(c,t)|
  t <= T
}.sort_by{|(c,t)|c}[0]&.[](0) || 'TLE'


n,t = gets.chomp.split(' ').map(&:to_i)
min_c = 1001
n.times do
  path =  gets.chomp.split(' ').map(&:to_i)
  if path[1] <= t
    if path[0] < min
      min = path[0]
    end
  end
end
if min < 1001
  puts min
else
  puts "TLE"
end


n,t=gets.split.map(&:to_i)
ans=Float::INFINITY
n.times do
  c,ti=gets.split.map(&:to_i)
  if ti<=t
    ans=[ans,ti].min
  end
end
puts ans==Float::INFINITY ? 'TLE' : ans


a,b=gets.split.map &:to_i
s=[]
y=[]
a.times{|i|s[i],y[i]=gets.split.map &:to_i}
ans=s.zip(y).sort.bsearch{|x|x[1]<b} || "TLE"
puts ans=="TLE" ? "TLE":ans[0]


use std::cmp::min;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u32 = read();
    let t: u32 = read();
    let mut m: u32 = 1001;
    for _ in 0..n {
        let c: u32 = read();
        let v: u32 = read();
        if t >= v {
            m = min(c, m);
        }
    }
    if m == 1001 {
        println!("TLE");
    } else {
        println!("{}", m);
    }
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:u32 = read();
    let t:u32 = read();
    let mut min: u32 = 1001;
    for _ in 0..n {
        let c:u32 = read();
        let v:u32 = read();
        if t >= v && c < min {
            min = c;
        }
    }
    if min == 1001 {
        println!("TLE");
    } else {
        println!("{}", min);
    }
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let t: usize = read();
    let mut minv = std::usize::MAX;

    for _ in 0..n {
        let c: usize = read();
        let ti: usize = read();

        if ti <= t {
            if c < minv {
                minv = c;
            }
        }
    }

    if minv == std::usize::MAX {
        println!("TLE");
        return;
    }
    println!("{}", minv);
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let t: usize = read();
    let mut minv = std::usize::MAX;

    for _ in 0..n {
        let c: usize = read();
        let ti: usize = read();

        if ti <= t {
            if c < minv {
                minv = c;
            }
        }
    }
    println!("{}", minv);
}


use std::cmp::min;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u32 = read();
    let t: u32 = read();
    let mut m: u32 = 1001;
    for _ in 0..n {
        let c: u32 = read();
        let v: u32 = read();
        if t >= v {
            m = min(c, m);
        }
    }
    if min == 1001 {
        println!("TLE");
    } else {
        println!("{}", m);
    }
}


use std::cmp::min;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u32 = read();
    let t: u32 = read();
    let mut min: u32 = 1001;
    for _ in 0..n {
        let c: u32 = read();
        let v: u32 = read();
        if t >= v {
            min = min(c, min);
        }
    }
    if min == 1001 {
        println!("TLE");
    } else {
        println!("{}", min);
    }
}


import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func toTuple<T>(_ args: [T]) -> (T, T, T) { (args[0], args[1], args[2]) }
func toTuple<T>(_ args: [T]) -> (T, T, T, T) { (args[0], args[1], args[2], args[3]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }
func readDoubles() -> [Double] { readLine()!.split(separator: " ").map { Double($0)! } }
func readStrings() -> [String] { readLine()!.split(separator: " ").map { String($0) } }

let (n, t) = toTuple(readInts())
var ans = 1001
for _ in 0..<n {
  let (ci, ti) = toTuple(readInts())
  guard ti <= t else { continue }
  ans = min(ans, ci)
}
print(ans == 1001 ? "TLE" : ans)


let NT: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var res = Int(1e5)
var can = false
for _ in 1...NT[0] {
    let ct: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
    if ct[1] <= NT[1] {
        can = true
        res = min(res, ct[0])
    }
}
print(can ? res : "TLE") // (๑•ૅㅁ•๑)


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (N, T) = (input[0], input[1])
var ans = 10000
for _ in 0..<N {
    let input = readIntSplit(by: " ")
    let (c, t) = (input[0], input[1])
    if t <= T {
        ans = min(ans, c)
    }
}
print(ans>1000 ? "TLE" : ans)


let NT: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var res: Int = Int(1e9)
for _ in 1...NT[0] {
  let ct: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
  res = ct[1] > NT[1] ? res : min(res, ct[0])
}
print(res != 0 ? res : "TLE")


let NT: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var res: Int = 1e9
for _ in 1...NT[0] {
  let ct: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
  res = ct[1] > NT[1] ? res : min(res, ct[0])
}
print(res != 0 ? res : "TLE")


let NT: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var res: Int = 0
for _ in 1...NT[0] {
  let ct: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
  res = ct[1] > NT[1] ? res : min(res, ct[0])
}
print(res != 0 ? res : "TLE")


const main = (input) => {
  const lines = input.trim().split("\n");
  const [N, T] = lines[0].split(' ').map(x => parseInt(x));
  let minCost = 10000;
  lines.slice(1).forEach(line => {
    const [c, t] = line.split(' ').map(str => parseInt(str));
    if (t <= T && c < minCost) {
      minCost = c;
    }
  });

  if (minCost === 10000) {
    console.log('TLE');
  } else {
    console.log(minCost);
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [a,b]=t.s(2)
  let c=[],d=[],l=1001
  for(let i=0;i<a;i++){
    c.push(t.n())
    d.push(t.n())
  }
  for(let i=0;i<a;i++){
    if(d[i]<=b&&l>c[i]){
      l=c[i]
    }
  }
  t.o(l==1001?'TLE':l)
}
main()


const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, t] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const [, ...ct] = stdin
  .trim()
  .split('\n')
  .map(e => e.split(' ').map(Number))

const filtered = ct.filter(e => e[1] <= t)

const ans = _ => {
  if(filtered.length <= 0){
    return 'TLE'
  }

  return Math.min(...filtered.map(e=>e[0]))
}

console.log(ans())


const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [a,b]=t.s(2)
  let c=[],d=[],l=1001
  for(let i=0;i<a;i++){
    c.push(t.n())
    d.push(t.n())
  }
  for(let i=0;i<a;i++){
    if(d[i]<b&&l>c[i]){
      l=c[i]
    }
  }
  t.o(l==1001?'TLE':l)
}
main()


s = input()
t = input()
count = 0
for id in range(3):
    if s[id] == t[id]: count += 1
else: print(count)


s = input()
t = input()

ans = 0
for ss, tt, in zip(s, t):
    if ss==tt:
        ans+=1
print(ans)


tenkikyohou = input()
tenki = input()

ans = 0

for i in range(3):
    if tenkikyohou[i] == tenki[i]:
        ans += 1

print(ans)


S = list(input())
T = list(input())
c = 0
for i in range(2):
    if S[i] == T[i]:
        c += 1
print(c)


s = input()
t = input()
ans = 0

for i in range(s):
  ans += s[i] == t[i]

print(ans)


s = int(input())
t = int(input())
count = 0
for i in range(len(s)):
    if s[i] == t[i]:
        count += 1

print(count)


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		String S = sc.next();
		String T = sc.next();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			if (S.charAt(i) == T.charAt(i)) ans++;
		}
		System.out.println(ans);
	}

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		String s = fs.next();
		String t = fs.next();

		int ans = 0;
		for(int i = 0; i < s.length(); i++) {
			char sAt = s.charAt(i);
			char tAt = t.charAt(i);
			if(sAt == tAt) {
				ans++;
			}
		}

		System.out.println(ans);
	}

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

}


/**
 * Dennis Lo
 * 09/01/2019
 */

import java.util.*;
import java.io.*;

class Main {
    FileInputStream fs;
    InputStream is;
    PrintWriter out;
    String INPUT = "";

    void solve() {
        String a = ns(), b = ns();
        int res = 0;
        for(int i = 0; i < 3; i++) {
            if(a.charAt(i) == b.charAt(i))
                res++;
        }
        out.println(res);
    }

    /*
     ** Credit to Uwi Tenpen for fast I/O **
     */
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        solve();
        out.flush();
        if(!INPUT.isEmpty()) {
            tr(System.currentTimeMillis() - s + "ms");
        }
    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1) {
            throw new InputMismatchException();
        }
        if(ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch(IOException e) {
                throw new InputMismatchException();
            }
            if(lenbuf <= 0) {
                return -1;
            }
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0; i < n; i++) {
            map[i] = ns(m);
        }
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0; i < n; i++) {
            a[i] = ni();
        }
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if(b == '-') {
            minus = true;
            b = readByte();
        }

        while(true) {
            if(b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if(b == '-') {
            minus = true;
            b = readByte();
        }

        while(true) {
            if(b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private void tr(Object... o) {
        if(INPUT.length() > 0) {
            System.out.println(Arrays.deepToString(o));
        }
    }
}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static InputStream is;
    static PrintWriter out;
    static String INPUT = "";

    static void solve() {
        String s = ns();
        String t = ns();

        int count = 0;
        for (int i = 0; i < 3; i++) {
            if (s.charAt(i) == t.charAt(i)) {
                count++;
            }
        }

        out.println(count);
    }

    public static void main(String[] args) throws Exception {
        long S = System.currentTimeMillis();
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        solve();
        out.flush();
        long G = System.currentTimeMillis();
        tr(G-S+"ms");
    }

    private static boolean eof() {
        if(lenbuf == -1)return true;
        int lptr = ptrbuf;
        while(lptr < lenbuf)if(!isSpaceChar(inbuf[lptr++]))return false;

        try {
            is.mark(1000);
            while(true){
                int b = is.read();
                if(b == -1){
                    is.reset();
                    return true;
                }else if(!isSpaceChar(b)){
                    is.reset();
                    return false;
                }
            }
        } catch (IOException e) {
            return true;
        }
    }

    private static byte[] inbuf = new byte[1024];
    static int lenbuf = 0, ptrbuf = 0;

    private static int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }

    private static int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private static double nd() { return Double.parseDouble(ns()); }
    private static char nc() { return (char)skip(); }

    private static String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private static char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private static char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private static int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private static int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }

    // Union-Find
    // https://algs4.cs.princeton.edu/15uf/UF.java.html
    public static class UnionFind {
        private int count = 0;
        private int[] parent, rank;

        public UnionFind(int n) {
            count = n;
            parent = new int[n];
            rank = new int[n];
            for (int i = 0; i < n; i++) {
                parent[i] = i;
            }
        }

        public int find(int p) {
            while (p != parent[p]) {
                parent[p] = parent[parent[p]];
                p = parent[p];
            }
            return p;
        }

        public void union(int p, int q) {
            int rootP = find(p);
            int rootQ = find(q);
            if (rootP ==rootQ) return;
            if (rank[rootQ] > rank[rootP]) {
                parent[rootP] = rootQ;
            } else {
                parent[rootQ] = rootP;
                if (rank[rootP] == rank[rootQ]) {
                    rank[rootP]++;
                }
            }
            count--;
        }

        public int count() {
            return count;
        }

        public void print() {
            out.println("Parent:");
            for (int i : parent) {
                out.print(i);
                out.print(" ");
            }
            out.println();
            out.println("Rank:");
            for (int i : rank) {
                out.print(i);
                out.print(" ");
            }
            out.println();
        }
    }

    // Dijkstra
    // Return min distance from start to end O(ElogV) (negative cost is prohibited)
    // edge is int[3] array {from,to,cost}
    // edges is edge list from specific node
    // all_edges is Map<from node number,edges>
    static int dijkstra(Map<Integer,List<int[]>> all_edges,int start,int end,int max_node_number) {
        int[] distance = new int[max_node_number + 1];
        Arrays.fill(distance, -1);
        PriorityQueue<int[]> p_que = new PriorityQueue<>((a,b) -> ((distance[a[0]] + a[2]) - (distance[b[0]] + b[2])));
        distance[start] = 0;
        List<int[]> edges = all_edges.get(start);
        p_que.addAll(edges);
        while (distance[end] < 0) {
            int[] nearest_edge = p_que.poll();
            assert nearest_edge != null;
            if (distance[nearest_edge[1]] < 0) {
                distance[nearest_edge[1]] = distance[nearest_edge[0]] + nearest_edge[2];
                if (all_edges.containsKey(nearest_edge[1])) {
                    edges = all_edges.get(nearest_edge[1]);
                    for (int[] edge : edges) {
                        if (distance[edge[1]] < 0) p_que.add(edge);
                    }
                }
            }
        }
        return distance[end];
    }

    // Enumerate primes in [2, n] with O(n log log n)
    public static List<Integer> sieveOfEratosthenes(int n) {
        boolean[] isPrime = new boolean[n+1];
        Arrays.fill(isPrime, true);
        for (int i = 2; i * i <= n; i++) {
            if (isPrime[i]) {
                for (int j = i + i; j <= n; j += i) {
                    isPrime[j] = false;
                }
            }
        }
        List<Integer> primes = new ArrayList<>();
        for (int i = 2; i <= n; i++) {
            if (isPrime[i]) {
                primes.add(i);
            }
        }
        return primes;
    }

    // Count divisor
    public static int countDivisor(int n) {
        int[] list = new int[n + 1];
        Arrays.fill(list, 0);
        int num = n;
        for (int i = 2; i <= n; i++) {
            while (num % i == 0) {
                list[i] = list[i] + 1;
                num /= i;
            }
        }
        int ans = 1;
        for (int i : list) {
            ans *= (i + 1);
        }
        return ans;
    }
}
v


import java.util.ArrayList;
import java.util.Scanner;

public class Main {
public static void main (String[] args){

	Scanner sc =new Scanner(System.in);
	ArrayList<String> list=new ArrayList<String>();

	while(sc.hasNext()) {
		list.add(sc.next());
	}

	int i=0;

	if(list.get(0)==list.get(3)) i++;
	if(list.get(1)==list.get(4)) i++;
	if(list.get(2)==list.get(5)) i++;

	System.out.print(i);

}
}


import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    String S =sc.next();
    String s[] =S.split("",0);
    String T =sc.next();
    String t[] =T.split("",0);
    int ans=0;
    for(int i=0;i<3;i++){
      if(s[i].equals(t[i])){ans =ans+1;}}
    System.ouut.println(ans);
  }
}


#include<iostream>
using namespace std;
int main()
{
    string m,d;
    int count = 0;
    cin >> m;
    cin >> d;
    for(int i = 0;i<3;i++){
        if(m[i]==d[i]){
            count++;
        }
    }
    cout << count;

}


#include <iostream>
using namespace std;

int main() {
	char y[4], z[4];
	int count = 0;
	for (int i = 0; i < 3; i++) {
		cin >> y[i];
	}
	for (int i = 0; i < 3; i++) {
		cin >> z[i];
	}
	for (int i = 0; i < 3; i++) {
		if (y[i] == z[i]) {
			count++;
		}
	}
	cout << count << endl;
	return 0;

}


#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <math.h>

using namespace std;

int main(void){
    string s, t;
    cin >> s >> t;
    int res = 0;

    for(int i = 0; i < (int)s.size(); i++){
        char ch1 = s[i];
        char ch2 = t[i];
        if(ch1 == ch2){
            res++;
        }
    }

    cout << res << endl;

    return 0;
}


/*
    -ensure correct output format
    -ensure printing required output
    -reread the problem statement
  */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pll;
typedef pair<ll,pair<ll,ll>>plll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
#define vll(v) v.begin(),v.end()
#define all(x) x.rbegin(),x.rend()
#define min3(a, b, c)   min(a, min(b, c))
#define max3(a, b, c)   max(a, max(b, c))
#define F first
#define S second
#define in  freopen("input.txt", "r", stdin)
#define out  freopen("output.txt", "w", stdout)
#define minheap int,vector<int>,greater<int>
#define pb push_back
#define eb emplace_back
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define bug cout<<"BUG"<<endl;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI  =3.141592653589793238463;
bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
       return (a.first > b.first);
}
ll lcm(ll a,ll b)
{
    if(a==0 || b==0)return 0;

    return a/__gcd(a,b)*b;
}

void input(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)cin>>ara[i];
}
void print(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)
        cout<<ara[i]<<" ";
    cout<<endl;
}

int main()
{

   fastread();

   ll i,j,n,m,p,a,sum=0,k,t,b,c,d,cnt=0,q,l,r,ans=0;

      bool flag=false;

      string str,ptr;

   cin>>a>>b;

   if(b==1)
   {
       cout<<0<<endl;

       return 0;
   }

   sum=a;

   cnt=1;

   while(sum<b)
   {
       sum+=(a-1);

       cnt++;
   }

   cout<<cnt<<endl;

}


#include <iostream>
#include <string>

int main() {
  std::string s(3), t(3);
  std::cin >> s >> t;
  int ans = 0;
  for (int i = 0; i < 3; ++i) ans += (s[i] == t[i]);
  std::cout << ans << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  vector<char>vec(3);
  for(ll i=0;i<3;i++){
    cin>>vec.at(i);
  }
  ll a=0;
  for(ll i=0;i<3;i++){
    char d;
    cin>>d;
    if(vec.at(i)==d){
      a+=1;
    }
  }
  cour<<a<<endl;
  return 0;
}


#include <stdio.h>

int main() {
	char s[4];
	char t[4];
	int i, ans = 0;

	scanf("%s", s);
	scanf("%s", t);

	for (i = 0; i < 3; i++) {
		if (s[i] == t[i]) {
			ans++;
		}
	}

	printf("%d\n", ans);

	return 0;
}


#include <stdio.h>

int main (void) {
  char S[4], T[4];
  int i;
  int a = 0;

  scanf ("%s", S);
  scanf ("%s", T);

  for (i = 0; i < 3; i++) {
    if (S[i] == T[i]) {
      a++;
    }
  }

  printf ("%d", a);
}


#include <stdio.h>

int main(void){

  char S[4], T[4];
  int i, count;

  scanf("%s", &S);
  scanf("%s", &T);
  for(i = 0; i <= 2 ;i++)
  {
    if(S[i] == T[i])
    count++;
  }
  printf("%d", count);
return 0;
}


#include<stdio.h>

int main(void){
  char s[5],t[5];
  scanf("%s",s);
  scanf("%s",t);
  int c=0;
  for(int i=0;i<sizeof(s);i++){
    if(s[i]==t[i]){
      c++;
    }
  }

  printf("%d",c);
  return 0;
}


#include<stdio.h>

int main(void){
    char s[4], t[4];
    int i, n;

    scanf("%s%s",s,t);
    i=0;    n=0;
    while(s[i] != '\0'){
        if(s[i] == t[i]){
            n++;
        }
        i++;
    }
    printf("%d\n");
    return 0;
}


#include<stdio.h>
int main()
{
    char S[4],n[4];
    int i,j=0;

    scanf("%s%s",S,n);

    for(i=0;i<3;i++){
      if(S[i]==n[i]) j++;
    }

    printf("%d\n",j);


function Main(input) {
    input = input.trim()
  input = input.split("\n");
  var A = input[0].split("");
  var B = input[1].split("");
  var sum = 0;
  if(A[0]==B[0]) sum++;
  if(A[1]==B[1]) sum++;
  if(A[2]==B[2]) sum++;
  console.log(sum)
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	var ST = input.split("\n");
	var S = ST[0].split("");
	var T = ST[1].split("");

	var cnt = 0;
	for (var i = 0; i < S.length; i++){
		if (S[i] === T[i]) {
			cnt++;
		}
	}

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


const Main = (input) => {
const dataArray = input.split('\n');
const forecast = dataArray[0];
const weather = dataArray[1];
var hit = 0;
  for(var i = 0; i < 3; i++){
  	if(forecast[i] == weather[i]){
      hit += 1;
    }
  }
  console.log(hit);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
    var array = input.split(" ");
    var a = parseInt(array[0]);
    var b = parseInt(array[1]);
    var calc = Math.floor(b / a);
    if (b%a !== 0){
        calc++;
    }
    console.log(calc);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
   input = input.trim();
  const inp = input.split("\n");
  const a = inp[0].split(" ");
  const b = inp[1].split(" ");
  var ans = 0;
  for ( i = 0; i < 3; i++) {
	if (a[i]==b[i]) {
		ans++;
		}
    }
  console.log(ans);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const Main = (input) => {
    a = input.split('\n')
    b = a[0].split('')
    c = a[1].split('')
    n = 0
    for (let index = 0; index < b.length; index++) {
        if (b[index] == c[index]) {n += 1}
    }
    console.log(n);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func min(a, b int) int {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

func yesno(result bool) {
	if result {
		fmt.Fprintln(write, "Yes")
	} else {
		fmt.Fprintln(write, "No")
	}
}

func printansStr(result bool, a, b string) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func printansInt(result bool, a, b int) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func main() {
	defer write.Flush()

	var s, t string
	fmt.Fscan(read, &s, &t)

	cnt := 0
	for i := 0; i < 3; i++ {
		if s[i] == t[i] {
			cnt++
		}
	}
	fmt.Fprintln(write, cnt)

}


package main

import "fmt"

func main() {
	var s, t string
	fmt.Scan(&s, &t)

	cnt := 0
	for i := 0; i < 3; i++ {
		if s[i:i+1] == t[i:i+1] {
			cnt++
		}
	}
	fmt.Println(cnt)
}


package main

import "fmt"

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	cnt := 0
	for i := 0; i < len(s); i++ {
		if s[i] == t[i] {
			cnt++
		}
	}
	fmt.Println(cnt)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	S := getStdin()
	T := getStdin()

	ans := 0
	for i:=0 ; i<len(S) ; i++ {
		if S[i] == T[i] {
			ans++
		}
	}

	fmt.Printf("%d\n", ans)
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}


package main

import "fmt"

func main() {
	var A, B int
	fmt.Scan(&A, &B)
	fmt.Println(((B - 1) + (A - 1 - 1)) / (A - 1))
}


package main

import "fmt"

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	cnt := 0
	for i := 0; i < len(s)-1; i++ {
		if s[i] == t[i] {
			cnt++
		}
	}
	fmt.Println(cnt)
}


# 入力は以下の形式で標準入力から与えられる。
# S
# T
a_s = gets.chomp.split("")
a_t = gets.chomp.split("")

# ある 3 日間の天気予報が、長さ 3 の文字列 S として与えられます。
# S の i (1 ≤ i ≤ 3) 文字目が
# S のとき、i日目の天気予報が晴れだったことを、
# C のときは曇りだったことを、R のときは雨だったことを意味します。

# また 3 日間の実際の天気が、長さ 3 の文字列 T として与えられます。
# T の i (1 ≤ i ≤ 3)文字目が
# S のとき、i日目の実際の天気が晴れだったことを、
# C のときは曇りだったことを、
# R のときは雨だったことを意味します。

# p a_s
# p a_t
ans = 0
3.times do |idx|
  ans += 1 if a_s[idx] == a_t[idx]
end

# 3日間で天気予報が的中した日が何日あるかを出力してください。
p ans


f =->{[1,2,3].zip(gets.chars).map{|a| a*""}}
p (f[]&f[]).count


forecast = gets.chomp.split("")
result = gets.chomp.split("")

hits = forecast.zip(result).count do |f, r|
  f == r
end

p hits


n=gets.to_i
p (n-1)*n/2


a=gets.chars.each
b=gets.chars.each
ans=0
3.times{a.next==b.next ? ans+=1}
p ans


s = gets.chomp.split("")-
t = gets.chomp.split("")-
ans = 0
3.times do |i|
    ans += 1 if s[i] == t[i]
end
puts ans


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	e:chars,
        a:chars
    }
    let mut cnt = 0;
    if e[0]==a[0] { cnt += 1 }
    if e[1]==a[1] { cnt += 1 }
    if e[2]==a[2] { cnt += 1 }

    println!("{}", cnt);
}


fn main() {
    let s: Vec<char> = {
        let s = read::<String>();
        s.chars().into_iter().collect()
    };
    let t: Vec<char> = {
        let t = read::<String>();
        t.chars().into_iter().collect()
    };

    let mut ret = 0;
    for i in 0..3 {
        if s[i] == t[i] {
            ret += 1;
        }
    }

    println!("{}", ret);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();

    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let t: Vec<char> = read::<String>().chars().collect();
    let mut ans: u32 = 0;

    for i in 0..s.len() {
        if s[i] == t[i] {
            ans += 1;
        }
    }
    println!("{}", ans);
}


use proconio::{input, fastout};
use proconio::marker::Chars;

#[fastout]
fn main() {
    input! {
        S: Chars,
        T: Chars,
    }
    let mut cnt = 0;
    for i in 0..S.len() {
        if S[i] == T[i] {cnt += 1;}
    }
    println!("{}", cnt)
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input!{
        s: String,
        t: String,
    }
    println!("{}", s.chars().zip(t.chars()).filter(|(a, b)| a == b).count());
}


use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let s = read_as_string().chars().collect::<Vec<char>>();
    let t = read_as_string().chars().collect::<Vec<char>>();

    println!("{}", s.into_iter().zip(t.into_iter()).filter(|(x, y)| *x == *y).count());

}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let fc=readLine()!
let re=readLine()!
var result=0

for num in 0...2{
  let a=fc.index(fc.startIndex,offsetBy:num)
  let b=re.index(re.startIndex,offsetBy:num)

  if fc[a]==re[b] {
    result+=1
  }
}
print(result)


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let s = Array(readLine()!)
    let t = Array(readLine()!)

    var ans = 0
    for i in 0..<3 {
        if s[i] == t[i] {
            ans += 1
        }
    }

    print(ans)
}

main()


var S = readLine()!
var T = readLine()!
var suuji = 0

for num in 0...2{
  let Sa = S.index(S.startIndex, offsetBy: num)
  let Ta = T.index(T.startIndex, offsetBy: num)
  if S [Sa]==T [Ta] {
    suuji += 1
  }
}
print(suuji)


let s=Array(readLine()!)
let t=Array(readLine()!)
var count=0
for i in 0...2{
  if s[i]==t[i]{
    count+=1
  }
}


let s = Array(readLine()!.characters)
let t = Array(readLine()!.characters)

var i = 0
var o = 0
for i in 0..<3 {
	if s[i] == t[i] {
      o ++
    }
}

print( o )


let input_line = readLine() // 標準入力から１行目を取得
print(input_line)


import * as fs from "fs"

function solve() {
    const [S, T] = (require('fs').readFileSync("/dev/stdin", "utf8") as string).split("\n");
    let cnt = 0
    for (let i = 0; i < 3; i++) {
      if (S[i] === T[i]) {
        cnt += 1;
      }
    }
    console.log(cnt);
}

solve();


import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {
    const [s, t]: string[] = inp.split('\n').map(String);
    let ans: number = 0;
    for (let i: number = 0; i < 3; i++) {
        if (s[i] === t[i]) {
            ans++;
        }
    }
    console.log(ans);
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());


((input: string): void => {
    const [s, t] = input.split("\n").map(v => v.split(""))
    console.log(s.filter((v, i) => v == t[i]).length)
})(require('fs').readFileSync('/dev/stdin', 'utf8'));