Double Doors Regional P1 - Tudor Gets a Goat

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Tudor likes goats!

One day, Tudor finds himself inside a mall, the Honty Mall. He is participating in a game show where he has the chance to either win a goat or a car. In the rewards segment of the game show, Tudor gets to select one of three rooms, each of which is blocked from view by a set of double doors. Behind one set of double doors is a car, which Tudor doesn't want. Behind each of the other two sets of double doors is a goat, which Tudor will take home and nurture. Tudor will be happy with either goat.

Because Tudor often has trouble distinguishing among sets of double doors, the rooms are conveniently numbered 1, 2, and 3. Tudor merely has to say the number of the room he wants to inspect, after which he gets to open the double doors and claim his prize.

Jason, the host of the game, really wants Tudor to get a goat. To help him in his quest, Jason chooses to open the double doors of a room that Tudor didn't select which contains a goat. However, Tudor can't actually take that goat. That would be unethical.

With this information, Tudor suddenly starts to panic. Should he switch his room selection to the other room to get the goat?


1 \le N, M, P \le 3

M \ne P

N \ne P

Input Specification

The input consists of exactly three lines.

The first line of the input contains a single integer, N. The car is behind room number N.

The second line of the input contains a single integer, M. Tudor has selected room number M.

The third line of the input contains a single integer, P. Jason has opened room number P.

Output Specification

If Tudor should switch rooms, output Switch. Otherwise, output Stay.

Sample Data ZIP

Click here for ZIP.

Sample Input 1


Sample Output 1


Sample Input 2


Sample Output 2



  • -2
    SunnyLin  commented on Jan. 15, 2020, 5:15 p.m.

    This is like the monty halls problem. i guess thats y the malls called honty malls