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 PYTHON):

Solution:
from __future__ import print_function
from copy import deepcopy

try:
    xrange
except NameError:
    pass
else:
    range = xrange

def rotate(array):
    array2 = deepcopy(array)
    for i in range(8):
        for j in range(8):
            array2[j][7 - i] = array[i][j]
    return array2

def to_str(array):
    return '\n'.join(map(''.join, array))

def solve(lines):
    lines90 = rotate(lines)
    print(90)
    print(to_str(lines90))
    
    lines180 = rotate(lines90)
    print(180)
    print(to_str(lines180))
    
    lines270 = rotate(lines180)
    print(270)
    print(to_str(lines270))

if __name__ == '__main__':
    lines = []
    for _ in range(8):
        lines.append(list(raw_input().strip()))
    solve(lines)