char*b;a,T;main(){for(;~scanf("%ms%ms"+T,&a,&b);putchar(T?:10))T=*(&b)[bcmp(a,b)>0]++;}