f=format write(f(m<-strptime(s<-scan("stdin",r<-"%R"),r),c("%R %p",r)[1+!s==f(m,"%I:%M")]),1)