import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Function
import Data.Bits

main :: IO ()
main = readLn >>= main'
    where
        main' n = readContents 2 >>= print . solve n 

solve :: Int -> [[Int]] -> Int 
solve n [as, bs] = foldl1' xor $ (+) <$> as <*> bs

readLine :: IO [Int]
readLine = unfoldr (\s -> second (maybe B.empty snd . B.uncons) <$> B.readInt s) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine