#include <iostream>
#include <cstdio>
using namespace std;
const int MAX=80;

int arr[MAX];

int main() {
    int n;
    while(scanf("%d",&n)!=EOF){
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(arr[0]<arr[1]||arr[0]>arr[1]){
            cout<<0<<" ";
        }
        for(int i=1;i<n-1;i++){
            if(arr[i]>arr[i-1]&&arr[i]>arr[i+1]||arr[i]<arr[i-1]&&arr[i]<arr[i+1]){
                cout<<i<<" ";
            }
        }
        if(arr[n-1]>arr[n-2]||arr[n-1]<arr[n-2]){
            cout<<n-1<<endl;
        }
    }
}
// 64 位输出请用 printf("%lld")