-- Try yukicoder -- author: Leonardone @ NEETSDKASU main = putStrLn . unlines . solve . map words . tail . lines =<< getContents solve [xs, ys] = ans where ans = head . dropWhile g $ zipWith3 f xs ys [1..] f x y n = [show n, x, y] g [_, x, y] = x == y