a=list(input().split())
while a[0] != '@':
for i in range(int(a[1])):
if i == 0:
print(' '*(int(a[1])-1)+a[0])
elif i== int(a[1])-1:
print(a[0]*(2*int(a[1])-1))
else:
print(' '*(int(a[1])-i-1)+a[0]+' '*(2*i-1)+a[0])
print()
a=list(input().split())