A Rotation Problem

View as PDF

Submit solution

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

Author:
Problem types
Allowed languages
Java

While doing research for his law ISP, Ryan got a message from Swetlana asking him to rotate five strings, each N times. Being fascinated by this he searches for a definition and finds the following:

To rotate a string is to move the first character to the end. To rotate a string N times is to repeat the rotation N times.

Input Specification

Five lines, each containing an integer N (0 \le N \le 2^{30}), followed by a string of max 100 lowercase letters.

Output Specification

Five lines, each containing the string shifted N times.

Sample Input

2 sarah
5 caroline
1 alice
0 tiffany
4 vincent

Sample Output

rahsa
inecarol
licea
tiffany
entvinc

Plain Problem Statement

Rotate each given string N times.


Comments

There are no comments at the moment.