#include "stdio.h"
int main(){
int n;
int a[100];
while(scanf("%d",&n)!=EOF){
for(int i=0;i<n;++i)
scanf("%d",&a[i]);
if(a[0]>a[1]||a[0]<a[1])
printf("%d ",0);
for(int i=1;i<n-1;++i){
if((a[i-1]>a[i]&&a[i]<a[i+1])||(a[i-1]<a[i]&&a[i]>a[i+1]))
printf("%d ",i);
}
if(a[n-1]>a[n-2]||a[n-1]<a[n-2])
printf("%d ",n-1);
printf("\n");
}
}