s;main(i){while(s&&putchar(s%65537-1?++i%atoi(1+&s)?s:s++:10)-10||gets(&s,i=0));}