Problem: Create a program that rotates the pattern of 8 characters x 8 lines clockwise by 90 degrees, 180 degrees, and 270 degrees and outputs it.



Input

A pattern consisting of 8 characters x 8 lines is given. Characters consist of alphanumeric characters, half-width pound'#', and asterisk'*'.

Output

Output the rotated pattern in the following format.


90 (fixed half-width numbers)
Pattern rotated 90 degrees
180 (fixed half-width numbers)
180 degree rotated pattern
270 (fixed half-width numbers)
Pattern rotated 270 degrees


Examples

Input

#*******
#*******
#*******
#*******
#*******
#*******
#*******
########


Output

90
########
#*******
#*******
#*******
#*******
#*******
#*******
#*******
180
########
*******#
*******#
*******#
*******#
*******#
*******#
*******#
270
*******#
*******#
*******#
*******#
*******#
*******#
*******#
########


Input

*******
*******
*******
*******
*******
*******
*******


Output

90

*******
*******
*******
*******
*******
*******
*******
180

*******#
*******#
*******#
*******#
*******#
*******#
*******#
270
*******#
*******#
*******#
*******#
*******#
*******#
*******#

Solution (in JAVA):

Solution:
//Volume1-0133
import java.util.Scanner;

class Main {

	private static final int      L      = 8;
	private static       char[][] board,
	                              temp;

	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		board = new char[L][L];
		temp  = new char[L][L];
		for(int i=0;i<L;i++){
			board[i] = sc.nextLine().toCharArray();
		}
		for(int i=0;i<3;i++){
			turn();
			print(i);
		}
	}

	private static void turn(){
		copy(board,temp);
		for(int i=0;i<L;i++){
			for(int j=0;j<L;j++){
				board[j][L-1-i] = temp[i][j];
			}
		}
	}

	private static void copy(char[][] a,char[][] b){
		for(int i=0;i<L;i++){
			for(int j=0;j<L;j++){
				b[i][j] = a[i][j];
			}
		}
	}

	private static void print(int angle){
		System.out.println((angle+1)*90);
		for(int i=0;i<L;i++){
			for(int j=0;j<L;j++){
				System.out.print(board[i][j]);
			}
			System.out.println();
		}

	}
}