#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
const int N = 21;
int n;
int a[N];
void res (int n) {
if (a[0] != a[1]) cout << 0 << " ";
for (int i = 1; i < n - 1; i++) {
if ((a[i] > a[i - 1] && a[i] > a[i + 1]) || (a[i] < a[i - 1] && a[i] < a[i + 1])) cout << i << " ";
}
if (a[n -1] != a[n - 2]) cout << n - 1 << " ";
}
int main() {
while (cin >> n) {
for (int i = 0; i < n; i++) cin >> a[i];
res(n);
cout << endl;
}
return 0;
}
// 64 位输出请用 printf("%lld")