Tugan Roulette
Tuga has created a new game based on Russian Roulette! In this game two players are given a pistol with chambers in the drum. The drum of the pistol acts as a circular queue; the chambers are arranged such that after the last chamber is fired, the next shot comes from the first chamber. Tuga then loads some number of the chambers with bullets, and hands it to the two players. The two players are then allowed to either shoot the pistol immediately, or spin the chamber again and then shoot the pistol.
While playing, your opponent spins the drum, and takes a shot from a random chamber, which is empty. Given the location of all bullets in the barrel, your task is to determine whether you have a higher probability of not shooting a bullet if you fire the pistol again, or spin the drum and then fire it.
Input
The first line contains a single integer (
) - The number of chambers in the drum.
The second line contains integers
representing each of the chambers. If
is
, then the chamber has a bullet in it, otherwise it will be
, indicating it is empty.
Output
Output Spin if there is a higher probability of not firing a bullet if you spin the barrel first, and output Shoot otherwise. If they have the same probability, output Shoot, as spinning takes extra work.
Example
Input 1
6
1 0 1 0 0 0
Output 1
Spin
There is a probability of firing a bullet with chance when selecting a random chamber (spinning the drum). However, if we know that the last selected chamber was empty, then we know that the next chamber contains a bullet
times. This is a higher probability of containing a bullet, so we should choose to spin.
Input 2
6
0 0 1 1 1 0
Output 2
Shoot
In this case, Shoot gives us a of hitting a bullet, while
Spin gives us a chance.
Comments