## New Year's '15 P2 - Food Selection

View as PDF

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Inaho has been invited to Asseylum's party dedicated to celebrating the new year! Being very welcoming, Asseylum bought a lot of food for Inaho. Sadly, Inaho wishes to stay healthy and sets limits on his food intake. Having so much food to choose from, Inaho just couldn't process all this food, and decides to ask you to help him by filtering out only the food that he can eat from the menu.

Inaho limits himself to not exceed a certain amount of calories, fat, and sodium intake per serving. Luckily, Asseylum's menu has all the nutrition information that you need.

#### Input Specification

The first line of the input contains three integers: , , and , the caloric, fat, and sodium limit that Inaho set for himself, respectively, such that . The next line contains the integer , the number of items on the menu, such that . The line that follows contain integers , , , and , where is the number of servings in the food, and the rest are the amount of calories, fat, and sodium in the food, respectively, such that , . On the same line, following after a space, is the name of the food item, which may contain spaces, but no longer than characters.

#### Output Specification

For the food item, output its name if and only if , , and .

#### Sample Input

770 130 250
5
10 1210 3721 4399 Philly Cheese Steak
7 20 3433 5632 Portobello Sandwich
9 3241 1009 198 Shrimp Cocktail
8 3542 744 40 Hickory Bourbon Salmon
2 605 1062 128 Shrimp Po' Boy Flatbread

#### Sample Output

Shrimp Cocktail
Hickory Bourbon Salmon