f s|(a,_:b)<-span(/=';')s=putStrLn[a!!read[c]|c<-a,c<':']>>f b main=getLine>>=f