while True:
data=str(raw_input().strip())
if data=='@':break
st,row=map(str,data.split())
for i in range(int(row)):
if i==0:
print ' '*(int(row)-i-1)+st
elif i==int(row)-1:
print st*(int(row)*2-1)
else:
print ' '*(int(row)-i-1)+st+" "*(i*2-1)+st
print