#include <stdio.h> int main() { int num; while(scanf("%d",&num)!=EOF){ int nums[num]; for(int i=0;i<num;i++){ scanf("%d ",&nums[i]); } if(nums[0]!=nums[1]) printf("%d ",0); for(int i=1;i<num-1;i++){ if(((nums[i]>nums[i-1])&&(nums[i]>nums[i+1]))||((nums[i]<nums[i-1])&&(nums[i]<nums[i+1]))) printf("%d ",i); } if(nums[num-1]!=nums[num-2]) printf("%d",num-1); printf("\n"); } return 0; }