for(c<-" "*366;Array(m,d)=readLine split' 'map(_.toInt))Seq(226,153,136+(m+d/" "(m)+8)%c,10)map System.out.write