flag=1
while flag:
s=map(str,raw_input().strip().split())
a=s[0]
b=int(s[1])
if a!="@":
for i in range(1,b+1):
if i==1:
print (b-1)*" "+a
elif i==b:
print (2*i-1)*a
else:
print " "*(b-i)+a+" "*(2*i-3)+a
else:
flag=0
print