#include <stdio.h>

int main() {
	int k;
	while (scanf("%d", &k) != EOF) {
		int arr[80] = { 0 };
		int a = 0;
		int ext[80] = { 0 };
		for (int i = 0; i < k; i++) {
			scanf("%d", &arr[i]);			
		}
		for ( int j = 0; j < k-1; j++) {
			if (j == 0&&arr[0]!=arr[1]) {
				ext[a++] = j;
				continue;
			}
			if ((arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) || (arr[j] < arr[j - 1] && arr[j] < arr[j + 1])) {
				ext[a++] = j;
			}
		}
		if (arr[k-1]!=arr[k-2]) {
			ext[a] = k-1;
		}
		for (int i = 0; i <= a; i++) {
			printf("%d ", ext[i]);
		}
	}
	return 0;
}