## MWC '15 #2 P3: Breaking Ice

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Salarios77 is walking on ice, however it's getting warm and after he does every step the ice breaks! You are given Salarios77's walking routine, figure out if (and when) Salarios77 will step on the same block twice and fall into the water.

#### Input Specification

The first line will contain integer (number of steps, ).
Second line will be followed by letters indicating each respective move: U (up), D (down), R (right), or L (left).

#### Output Specification

You either output: Fell at N, or if Salarios77 does not fall then Safe!.

#### Sample Input

4
L L R R

#### Sample Output

Fell at 3

I think there is an extra space beside the R in the Input Specifications