while True:
try:
s=input()
if s[0]=="@":
break
s=s.split()
# print(s)
ch,n=s
n=int(n)
# print(ch," ",n)
print(" "*(n-1),ch,sep="")
for i in range(1,n-1):
print(" "*(n-i-1),ch," "*(2*i-1),ch,sep="")
if n!=1 :
print(ch*(2*n-1),sep="")
print()
except EOFError:
break