setting = input().rstrip().split(" ")
katana_count = int(setting[0])
HP = int(setting[1])

katana_attack = []
katana_throw = []

for i in range(katana_count):
    katana_status = input().rstrip().split(" ")
    katana_attack.append(int(katana_status[0]))
    katana_throw.append(int(katana_status[1])) 
