Farmer John's $N$ cows ($1 \le N \le 100000$), conveniently numbered $1 \ldots N$, are standing in a row. Cow $i$ has height $H_i$ ($1 \le H_i \le 1000000$).
Each cow looks toward the cows with higher index numbers. We say cow $i$ "looks up" to cow $j$ if $i < j$ and $H_i < H_j$. For each cow $i$, determine the index of the first cow in the row (the one with the smallest index) that cow $i$ looks up to.
Cows $1$ and $2$ both look up to cow $3$; cows $4$ and $5$ both look up to cow $6$; and cows $3$ and $6$ do not look up to any cow.