toInt x = read x :: Int

pair :: [(Int,Int)] -> [((Int,Int),(Int,Int))]
pair lst = [(x,y) | x<- lst ,y<- lst, (abs ((fst x) - (fst y))) == ((snd x) + (snd y))]


main = do
    n <- getLine
    lst <- getLine
    let nmap = zip [1..] (map toInt $ words lst)
    print $ pair nmap