import Data.List main = do e<-getLine e2<-getLine let (a:b:[])=map read (words e2)::[Int] putStrLn $ [if e4==a then e!!b else if e4==b then e!!a else e!!e4|e4<-[0..(length(e)-1)]]