#include "stdio.h"
int main() {
    int k;
    while (scanf("%d", &k) != EOF) {
        int arr[k];
        for (int i = 0; i < k; i++) {
            scanf("%d", &arr[i]);
        }
        if (arr[0] != arr[1])
            printf("%d ", 0);

        for (int i = 1; i < k - 1; i++) {
            if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1] || arr[i] < arr[i - 1] &&
                    arr[i] < arr[i + 1])
                printf("%d ", i);
        }
        if (arr[k - 1] != arr[k - 2]) {
            printf("%d ", k - 1);
        }





    }






    return 0;
}