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.
# LUOGU_RID: 125264316
def center_align_text(line):
    max_width = 1000  # 最大行宽度
    left_adjust = True
    padding = 0
    
    while len(line) < max_width:
        diff = max_width - len(line)
        left_padding = diff // 2
        right_padding = diff - left_padding

        if left_adjust:
            line = " " * left_padding + line + " " * right_padding
            left_adjust = False
            padding = left_padding
        else:
            line = " " * (left_padding + 1) + line + " " * (right_padding - 1)
            left_adjust = True
            padding = left_padding + 1

    return "*" + line[padding:-padding] + "*"

if __name__ == "__main__":
    try:
        while True:
            line = input()
            centered_line = center_align_text(line)
            print(centered_line)
    except EOFError:
        pass