## Problem J3: Returning Home

Jane's family has just moved to a new city and today is her first day of school. She has a list of instructions for walking from her home to the school. Each instruction describes a turn she must make. For example, the list

```R
QUEEN
R
FOURTH
R
SCHOOL```

means that she must turn right onto Queen Street, then turn right onto Fourth Street, then finally turn right into the school. Your task is to write a computer program which will create instructions for walking in the opposite direction: from her school to her home.

The input and output for your program will be formatted like the samples below. You may assume that Jane's list contains at least two but at most five instructions, and you may assume that each line contains at most 10 characters, all of them capital letters. The last instruction will always be a turn into the "SCHOOL".

```R
QUEEN
R
FOURTH
R
SCHOOL```

### Sample Output 1

```Turn LEFT onto FOURTH street.
Turn LEFT onto QUEEN street.
Turn LEFT into your HOME.```

```L
MAIN
R
SCHOOL```

### Sample Output 2

```Turn LEFT onto MAIN street.
Turn RIGHT into your HOME.```

Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 29, 2008

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

• (4/3)
I had to use def, hash, each_slice, transpose, to_a, map, reverse, pop, while, zip and if.

He used def and if...

• (9/1)
I wish I was as cool as FatalEagle.

• (5/1)
FatalEagle has always been my idol ever since he registered.

• (6/3)
SourSpinach > FatalEagle

• (10/1)
I haven't even solved this problem, so FatalEagle is better.

• (0/1)
Is this Python you're talking about?
'Cause def is define, which is a function, if I'm not mistaken.

• (0/1)
is the sample input correct?
because it says...
R
QUEEN
R
FOURTH
R
SCHOOL
and the output is:
Turn LEFT onto FOURTH street.
Turn LEFT onto QUEEN street.
Turn LEFT into your HOME.
I thought R was RIGHT, not LEFT.

• (0/1)
ohhhh
i didnt read the question

• (0/1)
why is my code giving a RE, a run time error??

• (0/1)
I don't see any submission on this problem by you...

• (0/1)
that's werid. I'll submit it again then.

• (0/1)
You're making an assumption that causes a certain case to fail. As it turns out, all three test cases incorporate this case. I suggest changing how you read your input.