for(c<-":"*readInt)printf("%tT\n",new java.util.Date((54000-(0/:readLine.split(c))(_*60+_.toInt))*1000))