#include<iostream> using namespace std; typedef struct { int tag; int x; }k; int main() { k arr[100]; int n; while (cin >> n) { for (int i = 0; i < n; i++) { cin >> arr[i].x; arr[i].tag = 0; } if (arr[0].x!= arr[1].x) { arr[0].tag = 1; } for (int i = 1; i < n - 1; i++) { if ((arr[i].x > arr[i - 1].x && arr[i].x > arr[i + 1].x) || (arr[i].x < arr[i - 1].x && arr[i].x < arr[i + 1].x)) { arr[i].tag = 1; } } if (arr[n-1].x != arr[n-2].x) { arr[n-1].tag = 1; } for (int i = 0; i < n; i++) { if (arr[i].tag == 1) { cout << i << " "; } } cout << endl; } }