import Control.Applicative ((<$>), (<*>)) import Control.Monad (guard) import Data.Vector.Unboxed (Vector, (!), (//)) import qualified Data.Vector.Unboxed as V import Data.Maybe (catMaybes) main :: IO () main = solve <$> readLn <*> (V.fromList <$> map read <$> words <$> getLine) >>= putStrLn solve :: Int -> Vector Int -> String solve n ss = maybe "-1" (\(a, b, c) -> unwords . map show $ [a, b, c]) $ f n ss where f :: Int -> Vector Int -> Maybe (Int, Int, Int) f m v | null ls = Nothing | null rs = Nothing | otherwise = Just (head rs) where ls = do i <- [0..m-3] j <- [i+1..m-2] k <- [j+1..m-1] let ti = v ! i let tj = v ! j let tk = v ! k guard $ ti > 0 && tj > 0 && tk > 0 guard $ ti /= tk && (ti - tj) * (tk - tj) > 0 return (i, j, k) rs = catMaybes $ do (i, j, k) <- ls let nv = v // [(i,0),(j,0),(k,0)] case f m nv of Nothing -> return $ Just (i, j, k) Just _ -> return Nothing