Created
July 13, 2014 02:01
-
-
Save tef/14acc9278211279fb88f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
output = [] | |
for line in sys.stdin.readlines(): | |
line = line.split() | |
for n in range(len(line)): | |
output.append(" ".join(line[n:]+line[:n])) | |
for line in sorted(output): | |
print line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment