w = int(input('Введи w: '))
l = int(input('Введи l: ')) + 1
b = [['[]'] * l] * w
f = 0
n = 0
for i in range(0,w):
for r in range(0,l):
n = 0
while n == 0:
if f == 0: #Флаг 0?
if r == l-1:
f = 1
print()
n = 1
else:
b[i][r] = '[*]'
print (b[i][r], end ='')
n = 1
elif f == 1: #Флаг 1?
if r == l-1:
f = 0
print()
n = 1
else:
b[i][r] = '[*'
f = 2
print (b[i][r], end ='')
n = 1
elif f == 2: #Флаг 2?
if r == l-1:
b[i][r] = ' *]'
f = 0
print()
n = 1
else:
f = 1
b[i][r] = ' *]'
n = 1
print (b[i][r], end ='')