Chords#4662

Chords

1 second
256 megabytes
Hard

Consider a circle. There are different points marked on it and numbered with integer numbers in range from to so that each number from the interval has two points corresponding to it.

Points with the same numbers are connected by segments. Thus we've got chords. Furthermore, the chords are numbered as well: the chord number connects the two different points with number . Apparently some of the chords may intersect. Now it would be nice to find out for each single chord the number of chords it intersects.

Input

In the first line of the input file there is a single integer number (1 \le n \le 10^5). In the next line there are integers in range from to - the numbers assigned to the points in the order of traversal. Each number is written exactly twice. All the numbers in the line are separated with spaces.

Output

The output file is supposed to contain exactly lines: on the -th line write the number of chords that -th chord intersects.

Examples

Example 1

Loading
Loading