while True:
try:
a = raw_input().strip().split();
c = a[0];
if c == '@':
break;
n = int(a[1]);
for i in range(1,n+1):
if i == n or i == 1:
print ' '*(n-i) + c*(2*i-1);
continue;
print ' '*(n-i) + c + ' '*(2*i-3) + c;
print '';
except EOFError:
break