while 1:s=input();b,c=s[2:].split(' ',1);print(c.rjust(int(b),s[0]))