jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
function Main(input) {
  var inputs = input.split("\n");
  var k = parseInt(inputs[0].split(" ")[1], 10);
  var l = inputs[1].split(" ").map(e => parseInt(e, 10)).sort((a, b) => b - a);
  var sum = 0;
  for (var i = 0; i < k; i++) sum += l[i];
  console.log(sum);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// https://atcoder.jp/contests/abc067/tasks/abc067_b
"use strict";
function Main(input) {
  const params = input.split("\n");
  // const [N, K] = params[0].split(" ").map(Number);
  const K = params[0].split(" ").map(Number)[1];
  const ln = params[1]
    .split(" ")
    .map(Number)
    .sort((a, b) => b - a);

  let len = 0;
  for (let i = 0; i < K; i++) {
    len += ln[i];
  }

  console.log(len);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	input = input.split("\n");

	var line1 = input[0].split(" ");
    var num = Number(line1[0]);
    var sel = Number(line1[1]);
    
    var data = input[1].split(" ");
    for(var i = 0; i < data.length; i++){
        data[i] = Number(data[i])
    }
    
    data.sort(function(a, b) {
        return (parseInt(a) > parseInt(b)) ? -1 : 1;
    });
    
    var sum = 0;
    for(var i =0; i<sel; i++){
        sum+=data[i]
    }
    console.log(sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n, k int
	con.Scan(&n, &k)
	l := make([]int, n)
	for i := 0; i < n; i++ {
		con.Scan(&l[i])
	}
	sort.Ints(l)
	m := 0
	for i := n - 1; i >= n-k; i-- {
		m += l[i]
	}
	con.Println(m)
	return nil
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	n, k := readInt(), readInt()
	l := make([]int, n)
	for i := range l {
		l[i] = readInt()
	}

	sort.Sort(sort.Reverse(sort.IntSlice(l)))
	ans := 0
	for i := 0; i < k; i++ {
		ans += l[i]
	}
	fmt.Println(ans)
}
//  [go]
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	nk := strings.Split(sc.Text(), " ")
	// n, _ := strconv.Atoi(nk[0])
	k, _ := strconv.Atoi(nk[1])

	sc.Scan()
	l := strings.Split(sc.Text(), " ")
	var ls []int

	for _, lss := range l {
		li, _ := strconv.Atoi(lss)
		ls = append(ls, li)
	}

	sort.Sort(sort.Reverse(sort.IntSlice(ls)))

	snake := 0

	for i := 0; i < k; i++ {
		snake += ls[i]
	}

	fmt.Println(snake)
}
//  [go]
package main

import (
	"fmt"
	"sort"
	//"math"
	// "sort"
	//"regexp"
)

var n, k, a, ans int

func main() {
	fmt.Scan(&n)
	fmt.Scan(&k)
	l := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a)
		l[i] = a
	}
	sort.Slice(l, func(i, j int) bool { return l[i] > l[j] })
	for i := 0; i < k; i++ {
		ans += l[i]
	}
	fmt.Printf("%d\n", ans)
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		fmt.Println(err)
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()
	K := scanInt()
	l := make([]int, N)
	for i := 0; i < N; i++ {
		l[i] = scanInt()
	}

	sort.Sort(sort.Reverse(sort.IntSlice(l)))

	total := 0
	for i := 0; i < K; i++ {
		total += l[i]
	}

	fmt.Println(total)
}
//  [ruby]
n,k=gets.split.map(&:to_i)
puts gets.split.map(&:to_i).sort.reverse[0..k-1].inject(:+)
//  [ruby]
N, K = gets.chomp.split.map(&:to_i)
# sort で配列の順番を直す reverse で配列末尾から参照
l = gets.chomp.split.map(&:to_i).sort.reverse

ans = 0

K.times do |i|
  ans += l[i]
end

puts ans
//  [ruby]
N, K = gets.split.map(&:to_i)
L = gets.split.map(&:to_i).sort{|a,b|b<=>a}[0,K]
puts L.inject(:+)
//  [ruby]
_,n,*a=`dd`.split.map(&:to_i)
p a.sort.reverse[0,n].sum
//  [ruby]
eval'N,K,*A='+`dd`.split*?,
p A.max(K).sum
//  [ruby]
n,k = gets.chomp.split(' ').map(&:to_i)
arr = gets.chomp.split(' ').map(&:to_i).sort.reverse
puts arr[0..(k-1)].sum
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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! {
        n: usize,
        k: usize,
        ll: [u32; n],
    };
    let mut l = ll.clone();
    l.sort_by(|a, b| b.cmp(a));
    println!("{}", l.iter().take(k).sum::<u32>());
}
//  [rust]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

use std::ops::Add;

fn main() {
    let (_n, k) = get!(usize, usize);
    let mut ll = get!(String).split_whitespace().map(|i| i.parse::<i32>().unwrap()).collect::<Vec<_>>();
    ll.sort();
    ll.reverse();
    println!("{}", ll.into_iter().take(k).fold(0, Add::add));
}
//  [rust]
fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn readn<T: std::str::FromStr>(delimiter: &str) -> Vec<T> {
    let s = read1::<String>();
    s.split(delimiter).map(|e| e.parse().ok().unwrap()).collect::<Vec<T>>()
}

fn main() {
    let nk = readn::<usize>(" ");
    let n = nk[0];
    let k = nk[1];

    let mut l = readn::<usize>(" ");
    l.sort_by(|a, b| b.cmp(&a));

    let mut sum = 0;
    for i in 0..k {
        sum += l[i];
    }

    println!("{}", sum);
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        k: usize,
        mut l: [usize;n],
    }
    l.sort();
    l.reverse();
    let mut sum = 0;
    for i in 0..k {
        sum += l[i];
    }
    println!("{}", sum);
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;


fn main() {
    input! {
    a:usize,
    b:usize,
    mut c:[usize;a],
    }
    c.sort();
    c.reverse();
    let mut d=0;
    for i in 0..b {
        d+=c[i]
    }
    println!("{}",d)
}
//  [rust]
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: usize,
        k: usize,
        mut ll: [usize; n]
    };
    ll.sort();
    ll.reverse();
    println!("{}", ll[0..k].iter().sum::<usize>());
}
//  [swift]
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)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
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)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#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, K) = (input[0], input[1])
let l = readIntSplit(by: " ").sorted().reversed()
var ans = 0
for i in 0..<K {
    ans += l[i]
}
print(ans)
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (_, k) = toTuple(readInts())
let li = readInts().sorted { $0 > $1 }
let ans = li[0..<k].reduce(0) { $0 + $1 }
print(ans)
//  [swift]
import Foundation
let rd = readLine()!.split(separator: " ").map({Int($0)!})
let a = readLine()!.split(separator: " ").map({Int($0)!}).sorted().reversed()
let start = a.startIndex
let end = a.index(a.startIndex, offsetBy: rd[1])
let sumArr = Array(a[start..<end])
print(sumArr.reduce(0,+))
//  [typescript]
"use strict";

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

function main(input) {
  const [[n, k], sticks] = input.split("\n").map(s => s.split(" ").map(Number));

  // 降順にソート
  sticks.sort((a, b) => b - a);

  const ans = sticks.slice(0, k).reduce((p, c) => p + c);
  console.log(ans);
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const 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 near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};
const main=()=>{
  let [n,k]=tnn(2)
  let l=desc(tnn(n))
  let a=0
  for(let i=0;i<k;i++)a+=l[i]
  to(a)
}
main()
//  [typescript]
const log = console.log;

const parseLines = (s: string) => s.trim().split("\n");
const parseSpaceSeparated = (line: string) => line.trim().split(" ");
const parseDecimalInt = (s: string) => parseInt(s);
const parseSpaceSeparatedDecimalInt = (line: string) =>
  parseSpaceSeparated(line).map(parseDecimalInt);

const descendingSorter = (a: number, b: number) => b - a;

const sumReducer = (accumulator: number, currentValue: number) =>
  accumulator + currentValue;
const sum = (numbers: number[]) => numbers.reduce(sumReducer, 0);

// ----

function Main(input: string): void {
  const [head, body] = parseLines(input);
  const [n, k] = parseSpaceSeparatedDecimalInt(head);
  const l = parseSpaceSeparatedDecimalInt(body);

  l.sort(descendingSorter);

  log(sum(l.slice(0, k)));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [, K] = input[0].map(Number);
  const L = input[1].map(Number);

  L.sort((a, b) => b - a);

  return L.slice(0, K).reduce((sum, l) => sum + l);
};

console.log(main(read()));
//  [python]
import numpy as np

N,T = map(int, input().split())
ct = [list(map(int, input().split())) for i in range(N)]
c = np.array([ct[i][0] for i in range(N)])
t = np.array([ct[i][1] for i in range(N)])
c_ = list(c[t<T])
if len(c_)==0:
    print("TLE")
else:
    print(np.min(c[t<=T]))
//  [python]
import numpy as np

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

cs = []
ts = []
for k in range(n):
    cc, tt = list(map(int,input().split()))
    cs.append(cc)
    ts.append(tt)
    

try:
    print(np.min(np.array(cs)[np.array(ts)<=t]))
except:
    print('TLE')
//  [python]
import numpy as np

n, T = [int(i) for i in input().split()]
ct = [int(i) for _ in range(n) for i in input().split()]

cs = np.array(ct[0::2])
ts = np.array(ct[1::2])

cs_fil = cs[ts <= T]

if len(cs_fil) == 0:
    print('TLE')
else:
    print(min(cs_fil))
//  [java]
import java.io.*;
import java.math.*;
import java.util.*;

class Main {
    private static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int[] nt = Arrays.stream(sc.nextLine().split(" +")).mapToInt(Integer::parseInt).toArray();
        int n = nt[0];
        int t = nt[1];

        int c = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            int[] ct = Arrays.stream(sc.nextLine().split(" +")).mapToInt(Integer::parseInt).toArray();
            if (ct[1] <= t && c > ct[0]) c = ct[0];
        }

        if (c == Integer.MAX_VALUE) {
            System.out.println("TLE");
        }
        else {
            System.out.println(c);
        }
        sc.close();
    }
}
//  [java]
import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Objects;
import java.util.StringTokenizer;


public class Main {

  class A {
    int c;
    int t;

    public A(int c, int t) {
      this.c = c;
      this.t = t;
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
      A a = (A) o;
      return c == a.c &&
              t == a.t;
    }

    @Override
    public int hashCode() {
      return Objects.hash(c, t);
    }
  }

  private void solve(InputReader in, PrintWriter out) {
    int n = in.nextInt();
    int T = in.nextInt();
    A[] arr = new A[n];
    for (int i = 0; i < n; i++) {
      arr[i] = new A(in.nextInt(), in.nextInt());
    }
    Arrays.sort(arr, Comparator.comparingInt(a -> a.c));
    for (int i = 0; i < n; i++) {
      if (arr[i].t <= T) {
        out.println(arr[i].c);
        return;
      }
    }
    out.println("TLE");

  }

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

  private void run() {
    try (
            InputReader in = new InputReader(System.in);
            PrintWriter out = new PrintWriter(System.out)) {
      solve(in, out);
    }
  }


  static class InputReader implements AutoCloseable {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }


    public int nextInt() {
      return Integer.parseInt(next());
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

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

    @Override
    public void close() {

    }
  }

}
//  [java]
import java.util.Comparator;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    static class Route {
        int c, t;

        Route(int c, int t) {
            this.c = c;
            this.t = t;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt(), t = scanner.nextInt();
        Route result = IntStream.range(0, n)
                .mapToObj(i -> new Route(scanner.nextInt(), scanner.nextInt()))
                .filter(route -> route.t <= t)
                .min(Comparator.comparingInt(route -> route.c))
                .orElse(null);
        System.out.println(result == null ? "TLE" : result.c);
    }
}
//  [cpp]
#include<iostream>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<algorithm>

#define rep(i, a) for (int i = 0; i < a; i++)
#define reps(i, s, a) for (int i = s; i < a; i++)
#define llint long long int
using namespace std;

const int N_MAX = 505;
const int INF = 9999999;

int main()
{
    int n, t, min = INF;
    cin >> n >> t;

    rep(i, n) {
        int co, ti;
        cin >> co >> ti;
        if (ti <= t && co < min) min = co;       
    }

    if (min == INF) cout << "TLE";
    else cout << min;
}
//  [cpp]
#include <iostream>
#include <algorithm>
using namespace std;
int main () {
    int N, M, ans=987654321;
    cin >> N >> M;
    for (int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        if (b<=M)
            ans=min(ans,a);
    }
    ans!=987654321 ? cout << ans : cout << "TLE";
    return 0;
}
//  [cpp]
#include <iostream>
using namespace std;

int main() {
	int n,t,ans=10000;
	cin>>n>>t;
	int cost[n],tim[n];
	for(int i=0;i<n;i++){
	    cin>>cost[i]>>tim[i];
	}
	for(int j=0;j<n;j++){
	    if(tim[j]<=t&&cost[j]<ans){
	        ans=cost[j];
	    }
	}
	if(ans==10000)cout<<"TLE";
	else cout<<ans;
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int n, t, c[max], h[max];
    int min=INT_MAX, flag=0;
    
    scanf("%d%d", &n, &t);
    rep(i, n){
        scanf("%d%d", &c[i], &h[i]);
        if (h[i]<=t&&min>c[i]) {
            min=c[i];
            flag++;
        }
    }
    
    if (flag) {
        printf("%d\n", min);
    } else {
        printf("TLE\n");
    }
    
    return 0;
}
//  [c]
#include<stdio.h>

int main(void)
{
  int n,T;
  scanf("%d%d",&n,&T);

  int i,c[n],t[n],min=1100;
  for(i=0;i<n;i++){
    scanf("%d%d",&c[i],&t[i]);
    if(t[i]<=T)
      if(c[i]<min)
        min = c[i];
  }

  if(min==1100)
    printf("TLE\n");
  else
    printf("%d\n",min);
  return 0;
}
//  [c]
 #include<stdio.h>
 int main(void)
 {
     int N,T,c[100],t[100];
     int i,j,m,tmp;

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

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

       i=0;
       m=0;
     while(i<N){
       if(t[i]>T){
         c[i]=0;
         m++;
       }
       i++;
     }

     if(m==N) { printf("TLE\n"); return 0; }

     for(i=0;i<N;i++){
       for(j=i+1;j<N;j++){
         if(c[i]>c[j]){
           tmp=c[i];
           c[i]=c[j];
           c[j]=tmp;
         }
       }
     }

     printf("%d\n",c[m]);

     return 0;
 }
//  [javascript]
function toNum (str) {
	return parseInt(str, 10);
}

// inputに入力データ全体が入る
function Main(input) {
	var N = toNum(input.split('\n')[0].split(' ')[0]);
	var T = toNum(input.split('\n')[0].split(' ')[1]);
	var roots = input.split('\n');
	roots.shift();
	var roots_2 = roots.filter(n => toNum(n.split(' ')[1]) <= T);
	if ( roots_2.length == 0 ) {
		console.log('TLE');
	} else {
		roots_2 = roots_2.map(n => n.split(' ')[0]);
		console.log(Math.min(...roots_2));
	}
}

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var T = parseInt(input[0].split(" ")[1]);
  n = new Array(N);
  t = new Array(N);
  var ans=1001;
  for(i=0;i<N;i++){
    tmp=input[i+1].split(" ");
    n[i]=parseInt(tmp[0]);
    t[i]=parseInt(tmp[1]);
    if(t[i]<=T){
      ans=Math.min(ans,n[i]);
    }
  }
  if(ans==1001){
    ans="TLE";
  }
  var ans;
  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
	var a = input.split("\n");
  var b = a[0].split(" ");
  var N = b[0]*1;
  var T = b[1]*1;
  var minCost = 10000;
  for(var i = 1; i <= N ; i++){
  	var d = a[i].split(" ");
    var c = d[0]*1;
    var t = d[1]*1;
    if(t > T){
    	continue;
    }
		if(c < minCost){
  	  minCost = c;
    }
  }
  if(minCost == 10000){
  	return "TLE";
  }
  return minCost;
}
console.log(Main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [go]
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
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
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n, t := scanInt(), scanInt()
	ans := 1 << 60
	for i := 0; i < n; i++ {
		c, a := scanInt(), scanInt()
		if t >= a {
			ans = min(ans, c)
		}
	}
	if ans == 1<<60 {
		fmt.Fprintln(wr, "TLE")
	} else {
		fmt.Fprintln(wr, ans)
	}
}
//  [go]
package main

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

func main() {
	io, flash := NewIO()
	defer flash()

	n, maxTime := io.ScanInt2()
	var routeCosts []int
	for i := 0; i < n; i++ {
		c, t := io.ScanInt2()
		if t <= maxTime {
			routeCosts = append(routeCosts, c)
		}
	}

	if len(routeCosts) == 0 {
		fmt.Println("TLE")
	} else {
		sort.Ints(routeCosts)
		fmt.Println(routeCosts[0])
	}
}

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func NewIO() (*IO, func()) {
	io := &IO{
		scanner: newScanner(),
		writer:  newWriter(),
	}
	return io, func() { io.writer.Flush() }
}

func newScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 10000000), 10000000)
	s.Split(bufio.ScanWords)
	return s
}

func newWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func (io *IO) ScanBytes() []byte {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Bytes()
}

func (io *IO) ScanString() string {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Text()
}

func (io *IO) ScanStrings(n int) []string {
	strs := make([]string, n)
	for i := 0; i < n; i++ {
		strs[i] = io.ScanString()
	}
	return strs
}

func (io *IO) Scan2DStrings(y, x int) [][]string {
	strings := make([][]string, y)
	for i := 0; i < y; i++ {
		strings[i] = io.ScanStrings(x)
	}
	return strings
}

func (io *IO) Scan2DGraph(y int) [][]string {
	strs := make([][]string, y)
	for i := 0; i < y; i++ {
		strs[i] = strings.Split(io.ScanString(), "")
	}
	return strs
}

func (io *IO) ScanInt() int {
	return int(io.ScanInt64())
}

func (io *IO) ScanInt2() (int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt3() (int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt4() (int, int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = io.ScanInt()
	}
	return ints
}

func (io *IO) Scan2DInts(y, x int) [][]int {
	ints := make([][]int, y)
	for i := 0; i < y; i++ {
		ints[i] = io.ScanInts(x)
	}
	return ints
}

func (io *IO) ScanInt64() int64 {
	i, err := strconv.ParseInt(io.ScanString(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *IO) ScanFloat64() float64 {
	i, _ := strconv.ParseFloat(io.ScanString(), 64)
	return i
}

func (io *IO) ScanFloat64s(n int) []float64 {
	floats := make([]float64, n)
	for i := 0; i < n; i++ {
		floats[i] = io.ScanFloat64()
	}
	return floats
}

func (io *IO) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N, T = get_ints
X = []
N.times do |i|
  X[i] = get_ints
end

xx = X.filter { |c, t| t <= T }

if xx.length > 0
  puts xx.sort { |a, b| a[0] <=> b[0] }.first[0]
else
  puts 'TLE'
end
//  [ruby]
N,T = gets.chomp.split(" ").map(&:to_i)
c,t = N.times.map{gets.split.map(&:to_i)}.transpose
min = 10000
N.times do |i|
  if T >= t[i]
    min = [min,c[i]].min
  end
end
if min == 10000
  puts "TLE"
else
  puts min
end
//  [ruby]
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
kai=0
ans.each{|x|
  (kai=x[0];break)if x[1]<=b
}
puts kai>0 ? kai: "TLE"
//  [rust]
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{BufWriter, Write};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($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, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($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:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! {
        n: usize,
        t: i32,
        ct:[(i32,i32); n],
    }
    let mut ct = ct;
    ct.sort();
    let mut check = true;
    for i in 0..n {
        if ct[i].1 <= t {
            puts!("{}\n", ct[i].0);
            check = false;
            break;
        }
    }
    if check {
        puts!("TLE");
    }
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: usize, t: usize, ct: [[usize; 2]; n]);

    let min = ct.iter().filter(|x| (*x)[1] <= t).map(|x| x[0]).min();

    println!(
        "{}",
        if min.is_some() {
            min.unwrap().to_string()
        } else {
            "TLE".to_string()
        }
    );
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [, T] = input[0].map(Number);
  const routes = input.slice(1).map((line) => line.map(Number));

  let min = Infinity;

  routes.forEach(([c, t]) => {
    if (t <= T && c < min) {
      min = c;
    }
  });

  return min === Infinity ? "TLE" : min;
};

console.log(main(read()));
//  [typescript]
const main = (input: string) => {
  const lines = input.trim().split("\n")
  const [N, T] = lines[0].split(" ").map(str => parseInt(str));
  const CT = lines.slice(1);
  const CTNumberList: number[][] = [];
  let minCost = 0;
  let answer: number | string;

  CT.forEach(ct => {
    CTNumberList.push(ct.split(" ").map(str => parseInt(str)))
  })

  CTNumberList.forEach(ct => {
    if(T >= ct[1] && (ct[0] < minCost || minCost === 0)) {
      minCost = ct[0]
    }
  })

  answer = minCost === 0 ? "TLE" : minCost
  console.log(answer)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
'use strict';

const main = input => {
  const [[N, T], ...costAndTime] = input.filter(x => x).map(str => str.split(' ').map(x => Number(x)));

  const temp = costAndTime.filter(arr => arr[1] <= T);
  const ans = temp.length >= 1 ? temp.reduce((acc, cur) => acc[0] < cur[0] ? acc : cur)[0] : 'TLE';

  console.log(ans);
};

main(require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/));
//  [python]
# Template 1.0
import sys, re
from decimal import *
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor, trunc, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()
t = input()
ans = 0
for i in range(3):
    if(s[i]==t[i]):
        ans+=1
print(ans)
//  [python]

import numpy as np
def main():
    s = input().split()
    t = input().split()
   
    ans = 0
    for i in range(3):
        if s[0][i] == t[0][i]:
            ans += 1

    print(ans)

    
if __name__ == '__main__':
    main()
//  [java]
import java.util.*;
import java.util.stream.*;

class Main{
	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		String a=s.next(),b=s.next();
		System.out.println(IntStream.range(0,a.length()).filter(i->a.charAt(i)==b.charAt(i)).count());
	}
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        String pText = std.next();
        String aText = std.next();
        String[] ps = pText.split("");
        String[] as = aText.split("");
        int result = IntStream.range(0, ps.length)
                .reduce(0, (acc, it) -> {
                    String p = ps[it];
                    String a = as[it];
                    if (p.equals(a)) {
                        acc++;
                    }
                    return acc;
                });

        System.out.println(result);
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 123456789012

int main(){
    ll i,j;
    ll n;
    
    VVI v(6060,VI(6060,0));
    string s,t;
    ll ans=0;
    cin>>s>>t;
    for(i=0;i<3;i++) if(s[i]==t[i]) ans++;
    cout<<ans<<endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<int>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 123456789012

int main(){
    ll i,j;
    ll n;
    
    VVI v(6060,VI(6060,0));
    string s,t;
    ll ans=0;
    cin>>s>>t;
    for(i=0;i<3;i++) if(s[i]==t[i]) ans++;
    cout<<ans<<endl;
    return 0;
}
//  [c]
#include<stdio.h>
int main(){
  char a[4];
  char b[4];
  scanf("%s",a);
  scanf("%s",b);
  int count=0;
  for(int i=0;i<3;i++){
    if(a[i]==b[i])
      count++;
  }
  printf("%d",count);
}
//  [c]
#include <stdio.h>
int main()
{
    int i,count=0;
    char s1[4],s2[4];
    scanf("%s",s1);
    scanf("%s",s2);
    for(i=0;i<3;i++)
    {
        if(s1[i]==s2[i])count++;
    }
    printf("%d",count);
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
	int i,n,j,c=0;
	char s[3],t[3];
	scanf("%s",s);
	scanf("%s",t);
	for(i=0;i<3;i++)
	{
		if(s[i]==t[i])
		{
			c++;
		}
	}printf("%d\n",c);
}
//  [javascript]
function Main(input) {
    input = input.split("\n")
    var S = input[0];
    var T = input[1];
    var count = 0;
    if(S[0] == T[0]){
      count++
    }
    if(S[1] == T[1]){
      count++
    }
    if(S[2] == T[2]){
      count++
    }
    console.log(count)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	input = input.trim();
  input = input.split("\n");
  var output = 0;
  for(var i = 0; i < 3; i++){
    var tmp1 = input[0].slice(i,i+1);
    var tmp2 = input[1].slice(i,i+1);
    if(tmp1 == tmp2){
       output++
       }
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'
function main(inp) {
  inp = inp.trim().split('\n')
  let ans = 0
  for (let i = 0; i < 3; i++) {
    if (inp[0][i] === inp[1][i]) ans++
  }
  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
// ProblemURL : https://atcoder.jp/contests/abc139/tasks/abc139_a
// ---------------------------------------------
package main

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

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}
func larger(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func smaller(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func largest(a, b, c int) (lgst int) {
	if a > b {
		lgst = a
	} else {
		lgst = b
	}
	if c > lgst {
		lgst = c
	}
	return
}
func smallerst(a, b, c int) (slst int) {
	if a < b {
		slst = a
	} else {
		slst = b
	}
	if c < slst {
		slst = c
	}
	return
}
func max(a []int) (idx, val int) {
	if len(a) == 0 {
		panic("func max requires at least one argument")
	}
	val = a[0]
	for i, aa := range a {
		if aa > val {
			idx, val = i, aa
		}
	}
	return
}
func min(a []int) (idx, val int) {
	if len(a) == 0 {
		panic("func min requires at least one argument")
	}
	val = a[0]
	for i, aa := range a {
		if aa < val {
			idx, val = i, aa
		}
	}
	return
}
func sum(a []int) int {
	res := 0
	for _, v := range a {
		res += v
	}
	return res
}
func isEven(n int) bool            { return n&1 == 0 }
func isOdd(n int) bool             { return n&1 == 1 }
func swap(a int, b int) (int, int) { return b, a }
func fill(a []int, val int) {
	for i := 0; i < len(a); i++ {
		a[i] = val
	}
	return
}
func calcMod(n int) int   { return n % mod }
func sigma(x int) int     { return x * (x + 1) / 2 }
func powInt(a, b int) int { return int(math.Pow(float64(a), float64(b))) }

var (
	sc = bufio.NewScanner(os.Stdin)
	bw = bufio.NewWriter(os.Stdout)
)

func init() {}
func ru() (n int) {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}
func ri() (n int) {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}
	b := sc.Bytes()
	neg := false
	if b[0] == 45 {
		neg = true
	}
	for _, v := range b {
		n = n*10 + int(v-48)
	}
	if neg {
		n = -n
	}
	return
}
func rs() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}
	return sc.Text()
}
func rb() []byte {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}
	return sc.Bytes()
}
func pf(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(bw, format, a...); err != nil {
		panic(err)
	}
}
func pln(a ...interface{}) {
	if _, err := fmt.Fprintln(bw, a...); err != nil {
		panic(err)
	}
}
func pall(a []int) {
	for _, v := range a {
		fmt.Fprintln(bw, v)
	}
}
func pallol(a []int) {
	s := fmt.Sprint(a)
	if _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {
		panic(err)
	}
}
func debug(a ...interface{}) {
	s := fmt.Sprint(a)
	if _, err := fmt.Fprintln(os.Stderr, s[1:len(s)-1]); err != nil {
		panic(err)
	}
}
func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1e7), 1e7)
	solve()
	bw.Flush()
}

const (
	// maxInt64  = 9223372036854775807  // 9e18
	// maxInt32  = 2147483647           // 2e9
	// maxUint64 = 18446744073709551615 // 1e19
	inf = 1 << 60
	mod = 1e9 + 7
)

type pair struct{ a, b int }
type point struct{ x, y int }

func solve() {
	s, t := rs(), rs()
	ans := 0
	for i := 0; i < len(s); i++ {
		if s[i] == t[i] {
			ans++
		}
	}
	pln(ans)
}
//  [go]
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)
 
func run(){
	
	s := next()
	t := next()
	count := 0
	for i := 0; i < 3; i++ {
		if s[i] == t[i] {
			count++
		}
	}
	Println(count)
}
 
// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}
 
func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}
 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}
//  [go]
package main

import (
	"fmt"
)

func main() {

	var S, T string
	fmt.Scanf("%s", &S)
	fmt.Scanf("%s", &T)

	var count int = 0
	for i := 0; i < 3; i++ {
		if S[i] == T[i] {
			count++
		}
	}

	fmt.Println(count)
}
//  [ruby]
s = gets.chomp.chars
t = gets.chomp.chars
count = 0
s.each.with_index do |w,i|
  if w == t[i]
    count += 1
  end
end
puts count
//  [ruby]
a,b=`dd`.split
ans=0
3.times{|i|a[i]==b[i]&&ans+=1}
p ans
//  [ruby]
s = gets.chomp
t = gets.chomp
ans = 0
3.times do |i|
  ans += 1 if s[i] == t[i]
end
puts ans
//  [rust]
use proconio::input;
use proconio::marker::Chars;
fn main() {
    input!{
        s:Chars, t:Chars
    };
    println!("{}", s.iter().zip(t.iter()).filter(|&x|x.0 == x.1).count());
}
//  [swift]
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 += 1
    }
}

print( o )
//  [swift]
let s=Array(readLine()!)
let t=Array(readLine()!)
var count=0
for i in 0...2{
  if s[i]==t[i]{
    count+=1
  }
}
print(count)
//  [swift]
var input:[Character]{return readLine()!.characters.map{$0}}
let S=input,T=input
print((0..<3).reduce(0){$0+(S[$1]==T[$1] ?1:0)})
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): any => {
  let tmp = ``
  const S = lines[0]
  const T = lines[1]
  const obj = { S, T }
  debug(obj)
  return obj
}

// solver
export const solve = (lines: string[]): string => {
  const { S, T } = parseLines(lines)

  let count = 0
  for(let i = 0; i < S.length; i++) {
   if (S.charAt(i) === T.charAt(i)) {
    count++
   }
  }
  return `${count}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { S: string, T: string} => {
  const S = lines[0]
  const T = lines[1]
  const obj = { S, T }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { S, T } = parseLines(lines)
  let count = 0
  for(let i = 0; i < S.length; i++) {
    if (S[i] === T[i]) {
      count++
    }
  }
  return `${count}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
const main = lines => {
  console.log(solve(lines));
};

const solve = (lines: string[]): string => {
  const [S, T] = parseLines(lines);

  var cnt = 0;

  for (let i = 0; i < 3; i++) {
    if (S.charAt(i) === T.charAt(i)) cnt++;
  }

  return cnt.toString();
};

const parseLines = (lines: string[]) => {
  const obj = lines;
  debug(obj);
  return obj;
};

const debug = (message?: any, ...optionalParams: any[]) => {
  if (!!process.env.LOCAL_DEBUG) console.log(message, ...optionalParams);
};

if (!process.env.LOCAL_DEBUG) {
  const { stdin: input, stdout: output } = process;
  input.resume();
  input.setEncoding('utf8');
  const lines = [];
  require('readline')
    .createInterface({ input, output })
    .on('line', line => lines.push(line))
    .on('close', () => main(lines));
}

export default solve;
//  [python]
import numpy as np


def main():
    A1, A2, A3 = map(int, input().split())
    if A1 + A2 + A3 >= 22:
        print('bust')
    else:
        print('win')


if __name__ == '__main__':
    main()
//  [python]
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353



A = list(map(int, sys.stdin.buffer.readline().split()))
s = A[0] + A[1] + A[2]
if s >= 22:
    print('bust')
else:
    print('win')
//  [python]
import numpy as np

A=np.array(input().split(),dtype=np.int32)

s=np.sum(A)

if(s>=22):
    print("bust")
else:
    print("win")
//  [java]
import java.util.*;

class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int A[] = new int[3];
        for (int i=0; i<3; i++) {
            A[i] =  Integer.parseInt(sc.next());
        }
        sc.close();

        int sum = Arrays.stream(A).sum();
        if (sum>21)
            System.out.println("bust");
        else
            System.out.println("win");
    }
}