import Control.Monad

main :: IO ()
main = do
  ls <- replicateM 7 getLine
  mapM_ print $ solve ls

solve :: [String] -> [Int]
solve [] = []
solve (x:xs) = ((\[x,y] -> x - y) (map read . words $ x)):(solve xs)