while True:
try:
s=list(map(str,input().split()))
a=s[0]
if a=="@":
break
i=1
b=int(s[1])
while i<b:
if i==1:
print((b-i)*" "+a)
else:
print((b-i)*" "+a+(2*i-3)*" "+a)
i=i+1
else:
print((2*b-1)*a+"\n")
except EOFError:
break