1. 

/*

* ACM Programming Contest
* Problem: 490 - Rotating Sequences
* Status: Accepted
* Language: Java
* Runtime: 0.370
* Date: 2009-04-09
* Author: Simon Baumgarter
*/

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// BufferedReader in = new BufferedReader(new FileReader("input.txt"));
String line = "";
String[] lines = new String[100];
int maxLength = 0;
int lineCount = 0;
for(lineCount = 0; (line = in.readLine() ) != null; lineCount++){
lines[lineCount] = line;
maxLength = Math.max(maxLength, line.length());
}
lineCount --;

for(int charIndex = 0; charIndex < maxLength; charIndex++){
for(int lineIndex = lineCount; lineIndex >= 0 ; lineIndex--){
String l = lines[lineIndex];
if(l.length() > charIndex){
System.out.print(l.charAt(charIndex));
}else
System.out.print(" ");
}
System.out.println();
}
}
}