Given an array, find out the indices of all the local maxima and minima.

A local maximum of an array a[0], a[1], ..., a[n-1] is defined as a[i] such that there exist k1 and k2 satisfying k1<=i<=k2, with

a[k1]=..=a[i]=...=a[k2], a[k1-1]<a[k1] if k1-1>=0 and a[k2]>a[k2+1] if k2+1<n.

Similarly, a local minimum is defined as a[i] such that there exist k1 and k2 satisfying k1<=i<=k2, with

a[k1]=..=a[i]=...=a[k2], a[k1-1]>a[k1] if k1-1>=0 and a[k2]<a[k2+1] if k2+1<n.

Example:

Input:

2 4 6 3 3 3 5 7 8 9 1

Output:

0 2 3 4 5 9 10