i,s[999][9];main(k,t){for(strcmp();gets(s+i)?qsort(s,i++,36,strcmp):strlen(t=++k%i+s)-k/i?k<<19:puts(t););}