f ::[String]->[String]->[String]->[Int]
f [] _ _ =[]
f (x:xs) ns ms=let d=length (filter (== x) ns)- length (filter (== x) ms)
               in d:f xs ns ms

main = do
      x<-getContents
      let y=lines x
          n=read (head y)::Int
          ns=take n $ tail y
          ms=drop (n+2) y
      putStrLn $ show $ maximum $ (read "0"::Int) : f ns ns ms