for(;[y,m,d]=readline().split(' '),y-=m<3;print(d%7))d-=y%400%7-y%100*4+y%4*2-'#032503514624'[m]
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page