#include<iostream>
#include<cstdio>
using namespace std;
const int MAXN=80;
int arr[MAXN];
int main() {
    int k;
    while(scanf("%d",&k)!=EOF){
        for(int i=0;i<k;++i){
            scanf("%d",&arr[i]);
        }
        for(int i=0;i<k;++i){
            if(i==0){
                if(arr[i]!=arr[i+1]){
                    cout<<i<<" ";
                }
            }
            else if(i==k-1){
                if(arr[i]!=arr[i-1]){
                    cout<<i<<" ";
                }
            }
            else{
                if((arr[i]>arr[i-1]&&arr[i]>arr[i+1])||(arr[i]<arr[i-1]&&arr[i]<arr[i+1])){
                    cout<<i<<" ";
                }
            }
        }
        cout<<endl;
    }
	return 0;
}