char s[9];main(i){for(;gets(s);puts(""))for(;*s<=s[2];++*s)for(i=atoi(s+4);i--;)putchar(*s);}