#! /usr/bin/env python

# @author Billy Wilson Arante
# @modified 12/25/2015 PHT

width = int(input())

while True:
    in_str = input()

    if in_str == "END":
        break
    else:
        total_dots = width - len(in_str)

        left_dots = 0
        right_dots = 0
        if (total_dots % 2) != 0:
            left_dots = total_dots // 2 + 1
            right_dots = total_dots // 2
        else:
            left_dots = total_dots // 2
            right_dots = total_dots // 2

        print(left_dots * "." + in_str + right_dots * ".")
