12386 - Safe Password   

Description

"dontouchM" is a message about your personal safety.

You want to encode this password to protect it, and you got an idea.

First, you save this password into an array, and shift it left N(if N is negative)or right N(if N is positive) according to your input N.

Next, save it in column-major order into a 3*3 array.

Finally, output it in row-major order.

For example, you input 1, then you get Mdontouch.

Next, put it into 3*3 2D array in column-major.

M n u
d t c
o o

h

Now, print it in row-major which is Mnudtcooh

 

GL HF!

Input

N, shift value, decide shift direction and distance.

Notice:|N| <9

Output

Your encodeed password. Remember change your line in the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss