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