i;char s[];main(k){for(;i||gets(s);putchar(k>s[2]?i=0,10:k))k=*s+i++/atoi(s+4);}