Almost every text editor has a built-in function of center text alignment. The developers of the popular in Berland text editor «Textpad» decided to introduce this functionality into the fourth release of the product.

You are to implement the alignment in the shortest possible time. Good luck!
The input file consists of one or more lines, each of the lines contains Latin letters, digits and/or spaces. The lines cannot start or end with a space. It is guaranteed that at least one of the lines has positive length. The length of each line and the total amount of the lines do not exceed 1000.
import sys

m = 0
l = []

for i in sys.stdin:
    l.append(i.rstrip())
    m = max(len(l[-1]), m)

print('*' * (m + 2))
for i in l:
    s = m - len(i)
    print('*' + (' ' * (s//2)) + i + (' ' * (s - s//2)) + '*')
print('*' * (m + 2))
