for(;r=readline();print(r[0]=="A"?c?1:2:r[0]=="B"?c?3:4:c?5:n<31?6:7))c=(n=r.slice(1))<16
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page