Algorithms Final Exam

No attempts yetTime limit1sMemory limit256 MB

Problem

Sangdeok's final exam is almost here. The algorithms section he takes has NN students. Algorithms is graded on a curve, so no two students share a rank, and each student's satisfaction depends on the midterm rank and the final rank. Rank 1 is the highest rank. For the student who placed ii-th on the midterm, the satisfaction AiA_i is defined as follows.

  • Ai=BiCiA_i = B_i - C_i
  • BiB_i is the number of students who placed higher on the midterm and lower on the final than that student.
  • CiC_i is the number of students who placed lower on the midterm and higher on the final than that student.

Number the students by midterm rank. The student who placed ii-th on the midterm is student ii. Suppose five students got the results below.

Midterm rankFinal rank
Student 11st5th
Student 22nd4th
Student 33rd3rd
Student 44th2nd
Student 55th1st

For student 5, four students placed higher on the midterm and lower on the final, and no student placed lower on the midterm and higher on the final, so the satisfaction is 4. For student 1, no student meets the first condition and four students meet the second one, so the satisfaction is -4.

Write a program that prints the satisfaction of every student in the section.

Input

The first line contains the number of students NN (1N1000001 \le N \le 100000). The second line contains NN integers: the students who placed 1st through NN-th on the final, each written as that student's midterm rank, in that order.

Output

Print the final exam satisfaction of each student, one per line, ordered by midterm rank from 1st to NN-th.