画矩形
height,width,c,d = input().split()
height,width,d = int(height),int(width),int(d)
lis = [c * width if d else c + ' ' * (width - 2) + c for i in range(height) ]
'''
lis:
#####
# #
# #
#####
或
# #
# #
# #
# #
'''
if not d:print(c * width)for i in lis[1:-1]:print(i)print(c * width)
else:for i in lis:print(i)
或者:
height,width,c,d = input().split()
height,width,d = int(height),int(width),int(d)for i in range(height):if i == 0 or i == height - 1:print(c * width)else:if d == 0:print(c + ' ' * (width - 2) + c)else:print(c * width)