n,*a=$<.read.split.map &:to_i f=->u{ [*0...a.size].combination(3).find{|i,j,k| (a[i]-a[j])*(a[j]-a[k])<0&&(v=1<