It’s time for fun and business and the SoftUni team is organizing the coolest event in the year – the Palatka Conf. Unfortunately, there are some questions left unanswered – will there be enough room and food for everyone? Your task is to write a program that calculates the number of meals and beds and decides if they will be enough.
Normally, you know how many rooms and how much food you have, and the only variable is the number of people. At the Palatka Conf, the case is completely opposite – you know the number of people, but random hotels, tents and meals are coming every which way.
The input you receive will be in format {tents/food/rooms} {quantity} {type}. Tents are two types: normal and firstClass -> for two and three people, accordingly. Rooms are single, double and triple -> for 1, 2 and 3 people. Meals are only two types: musaka and zakuska. The musaka can feed two, while the zakuska is enough for 0. Calculate the total amount and print on the console if everyone is well fed and had a place to sleep.
Input:
-
On the first line you will receive an integer – the number of people coming to the Palatka Conf.
-
On the second line, you will receive another integer N – the number of lines to follow.
-
On the next N lines, you receive input in the format described above.
Output:
-
There are two lines of output. On the first line, print either:
-
Everyone is happy and sleeping well. Beds left: {number of beds left}
-
Some people are freezing cold. Beds needed: {number of beds needed}
-
On the second line, one of two choices:
-
Nobody left hungry. Meals left: {number of meals left}
-
People are starving. Meals needed: {number of meals needed}
Constraints:
-
N is an integer in range [1 .. 20]
-
All other numbers in the input are integers in range [0 … 100]
Examples:
