B - Center Alignment 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MiB

配点 : 200

問題文

英小文字からなる N 個の奇数長の文字列 S_1,S_2,\dots,S_N が与えられます。

S_1,S_2,\dots,S_N のうち最も長いものの長さを m とします。 以下の条件を満たす文字列 T_1,T_2,\dots,T_N を求めてください。

  • 条件:T_i はある非負整数 k について k 個の .S_ik 個の . をこの順に結合してできる、長さ m の文字列である。

制約

  • N1 以上 100 以下の整数
  • S_i は英小文字からなる長さ 1 以上 99 以下の奇数長の文字列

入力

入力は以下の形式で標準入力から与えられる。

N
S_1
S_2
\vdots
S_N

出力

N 行出力せよ。i\ (1 \leq i \leq N) 行目には T_i を出力せよ。


入力例 1

4
apple
blueberry
coconut
dragonfruit

出力例 1

...apple...
.blueberry.
..coconut..
dragonfruit

m=11 であり、T_1,T_2,T_3,T_4 はそれぞれ k=3,1,2,0 について問題文中の条件を満たしています。


入力例 2

6
abc
d
efghi
jkl
mnopq
r

出力例 2

.abc.
..d..
efghi
.jkl.
mnopq
..r..

Score : 200 points

Problem Statement

You are given N strings S_1,S_2,\dots,S_N of odd lengths consisting of lowercase English letters.

Let m be the length of the longest string among S_1,S_2,\dots,S_N. Find strings T_1,T_2,\dots,T_N satisfying the following condition.

  • Condition: T_i is a string of length m formed by concatenating k copies of ., S_i, and k copies of . in this order, for some non-negative integer k.

Constraints

  • N is an integer between 1 and 100, inclusive.
  • S_i is a string of odd length between 1 and 99, inclusive, consisting of lowercase English letters.

Input

The input is given from Standard Input in the following format:

N
S_1
S_2
\vdots
S_N

Output

Output N lines. The i-th line (1 \leq i \leq N) should contain T_i.


Sample Input 1

4
apple
blueberry
coconut
dragonfruit

Sample Output 1

...apple...
.blueberry.
..coconut..
dragonfruit

m=11, and T_1,T_2,T_3,T_4 satisfy the condition in the problem statement for k=3,1,2,0, respectively.


Sample Input 2

6
abc
d
efghi
jkl
mnopq
r

Sample Output 2

.abc.
..d..
efghi
.jkl.
mnopq
..r..