N,*A=`dd`.split.map &:to_i ans=(0...N-2).filter{(A[_1]!=A[_1+2])and((A[_1]A[_1+2])or(A[_1]>A[_1+1]and A[_1+1]