import Control.Applicative import Data.Vector (Vector, (!), (//)) import qualified Data.Vector as V main :: IO () main = solve <$> getLine <*> f >>= putStrLn where f = map read <$> words <$> getLine solve :: String -> [Int] -> String solve ss [i, j] = V.toList . f . V.fromList $ ss where f v = v // [(i, v ! j),(j, v ! i)]