'''
Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:

Mat size must be X. ( is an odd natural number, and  is  times .)
The design should have 'WELCOME' written in the center.
The design pattern should only use |, . and - characters.
Sample Designs

    Size: 7 x 21 
    ---------.|.---------
    ------.|..|..|.------
    ---.|..|..|..|..|.---
    -------WELCOME-------
    ---.|..|..|..|..|.---
    ------.|..|..|.------
    ---------.|.---------
    
    Size: 11 x 33
    ---------------.|.---------------
    ------------.|..|..|.------------
    ---------.|..|..|..|..|.---------
    ------.|..|..|..|..|..|..|.------
    ---.|..|..|..|..|..|..|..|..|.---
    -------------WELCOME-------------
    ---.|..|..|..|..|..|..|..|..|.---
    ------.|..|..|..|..|..|..|.------
    ---------.|..|..|..|..|.---------
    ------------.|..|..|.------------
    ---------------.|.---------------
Input Format

A single line containing the space separated values of  and .

Constraints

Output Format

Output the design pattern.

Sample Input

9 27
Sample Output

------------.|.------------
---------.|..|..|.---------
------.|..|..|..|..|.------
---.|..|..|..|..|..|..|.---
----------WELCOME----------
---.|..|..|..|..|..|..|.---
------.|..|..|..|..|.------
---------.|..|..|.---------
------------.|.------------
'''
def doorMat(n):
    l=[]
    for _ in range(m//2-2*i-1,i,-1):
        print('-',end='')
        l.append('-')
    print('.|',end='')
    for _ in range(i):
        if i>0:
            print('..|',end='')
    for _ in range(i,0,-1):
        if i>0:
            print('..|',end='')
    print('.',end='')
    print(*l,end='',sep='')
    print()
n,m=map(int,input().split())
for i in range(n//2):
    doorMat(i)
t=(m-7)//2
print('-'*t,'WELCOME','-'*t,sep='')
for i in range(n//2-1,-1,-1):
    doorMat(i)

'''
Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:

Mat size must be X. ( is an odd natural number, and  is  times .)
The design should have 'WELCOME' written in the center.
The design pattern should only use |, . and - characters.
Sample Designs

    Size: 7 x 21 
    ---------.|.---------
    ------.|..|..|.------
    ---.|..|..|..|..|.---
    -------WELCOME-------
    ---.|..|..|..|..|.---
    ------.|..|..|.------
    ---------.|.---------
    
    Size: 11 x 33
    ---------------.|.---------------
    ------------.|..|..|.------------
    ---------.|..|..|..|..|.---------
    ------.|..|..|..|..|..|..|.------
    ---.|..|..|..|..|..|..|..|..|.---
    -------------WELCOME-------------
    ---.|..|..|..|..|..|..|..|..|.---
    ------.|..|..|..|..|..|..|.------
    ---------.|..|..|..|..|.---------
    ------------.|..|..|.------------
    ---------------.|.---------------
Input Format

A single line containing the space separated values of  and .

Constraints

Output Format

Output the design pattern.

Sample Input

9 27
Sample Output

------------.|.------------
---------.|..|..|.---------
------.|..|..|..|..|.------
---.|..|..|..|..|..|..|.---
----------WELCOME----------
---.|..|..|..|..|..|..|.---
------.|..|..|..|..|.------
---------.|..|..|.---------
------------.|.------------
'''
def doorMat(n):
    l=[]
    for _ in range(m//2-2*i-1,i,-1):
        print('-',end='')
        l.append('-')
    print('.|',end='')
    for _ in range(i):
        if i>0:
            print('..|',end='')
    for _ in range(i,0,-1):
        if i>0:
            print('..|',end='')
    print('.',end='')
    print(*l,end='',sep='')
    print()
n,m=map(int,input().split())
for i in range(n//2):
    doorMat(i)
t=(m-7)//2
print('-'*t,'WELCOME','-'*t,sep='')
for i in range(n//2-1,-1,-1):
    doorMat(i)

Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:  Mat size must be X. ( is an odd natural number, and  is  times .) The design should have 'WELCOME' written in the center. The design pattern should only use |, . and - characters. Sample Designs      Size: 7 x 21      ---------.|.---------     ------.|..|..|.------     ---.|..|..|..|..|.---     -------WELCOME-------     ---.|..|..|..|..|.---     ------.|..|..|.------     ---------.|.---------          Size: 11 x 33     ---------------.|.---------------     ------------.|..|..|.------------     ---------.|..|..|..|..|.---------     ------.|..|..|..|..|..|..|.------     ---.|..|..|..|..|..|..|..|..|.---     -------------WELCOME-------------     ---.|..|..|..|..|..|..|..|..|.---     ------.|..|..|..|..|..|..|.------     ---------.|..|..|..|..|.---------     ------------.|..|..|.------------     ---------------.|.--------------- Input Format  A single line containing the space separated values of  and .  Constraints  Output Format  Output the design pattern.  Sample Input  9 27 Sample Output  ------------.|.------------ ---------.|..|..|.--------- ------.|..|..|..|..|.------ ---.|..|..|..|..|..|..|.--- ----------WELCOME---------- ---.|..|..|..|..|..|..|.--- ------.|..|..|..|..|.------ ---------.|..|..|.--------- ------------.|.------------