var inf = Number.MAX_SAFE_INTEGER;
function Main(input){
	input = input.split("\n");
	input = arr1dto2d(input);
	var t = input[0][1];
	var cost = inf;
	for(var i=1;i<input.length;i++){
		if(input[i][0]<cost&&input[i][1]<=t){
			cost = input[i][1];
		}
	}
	console.log(cost=inf?"TLE":cost)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());