Stepan's Air Conditioner#7234

Stepan's Air Conditioner

0,1 sekunt
256 megabaýt
Örän ýeňil

In Stepan's office, where he works as a programmer, a new type of air conditioner has been installed. This air conditioner is notable for its simple controls, featuring only two adjustable settings: the desired temperature and the operating mode.

The air conditioner can function in one of the following four modes:

The air conditioner is quite efficient, so when set to the appropriate mode, it adjusts the room temperature to the desired level within an hour.

Your task is to write a program that, given the current room temperature t_{room}, the desired temperature set on the air conditioner t_{cond}, and the operating mode, determines the temperature that will be reached in the room after an hour.

Giriş

The first line of the input contains two integers t_{room} and t_{cond}, separated by a single space (-50 \leq t_{room} \leq 50, -50 \leq t_{cond} \leq 50). The second line contains one word, written in lowercase Latin letters, indicating the operating mode of the air conditioner.

Çykyş

The output should be a single integer representing the temperature that will be established in the room after an hour.

Mysallar

1-nji mysal

Loading
Loading

Bellik

In the first example, the air conditioner is set to heating mode. After an hour, it will heat the room to the desired temperature of 20 degrees.

In the second example, the air conditioner is set to cooling mode. Since the room temperature is already lower than the desired temperature, the air conditioner will turn off automatically, and the room temperature will remain unchanged.