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.
#5B - Center alignment
#Lines of text:
l=[]
#The longest line:
maxlen=0
#While we have input, we append it to our list, 
try:
    while True:
        a=input()
        l.append(a)
        #keeping track of the longest line, which sets the general frame:
        if len(a)>maxlen:maxlen=len(a)
except:
    pass
#Knowing the length of the longest line, we first print the upper
#side of the '*' frame, which is one * longer than our text frames on each side
print("*"*(maxlen+2))
# u - uniformity switcher
u=1
#For each line in the text:
for each in l:
    #If the difference between the longest line and the current one is even:
    if (maxlen-len(each))%2:
        #we print one line closer to the left frame border,
        if u:
            u=0
            #And we are free to print the alligned text:
            print("*{text} *".format(text=each.center(maxlen-1,' ')))
        #and one line closer to the right frame border
        else:
            u=1
            print("* {text}*".format(text=each.center(maxlen-1,' ')))
    #else, we feel free to print a perfectly alligned text:
    else:
        print("*{text}*".format(text=each.center(maxlen,' ')))
#Then, we print the bottom lign of '*'
print("*"*(maxlen+2))