main=getLine>>=f f s@(c:l)=putStrLn s>>f[last$show$read[x]-read[y]|(x,y)<-zip l s]