main=getLine>>=f f s@(_:x)=putStrLn s>>f[last$show$read[a]-read[b]|(a,b)<-zip s x]