import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 1 ≤ N ≤ 1,000,000 -> long
long n = Long.parseLong(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
// -10^9 ≤ X ≤ 10^9 -> int
ArrayList<Integer> coordinates = new ArrayList<>();
int count = 0;
StringBuilder sb = new StringBuilder();
for (long l = 0; l < n; l++) {
int coordinate = Integer.parseInt(st.nextToken());
// 이미 리스트에 있는 좌표인지 확인
boolean isBigContain = false;
for (int i : coordinates) {
if (coordinate > i) {
isBigContain = true;
break;
}
}
if (isBigContain) {
count++;
sb.append(count).append(" ");
} else {
sb.append("0 ");
}
coordinates.add(coordinate);
}
System.out.println(sb);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 1 ≤ N ≤ 1,000,000 -> long
long n = Long.parseLong(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
// -10^9 ≤ X ≤ 10^9 -> int
ArrayList<Integer> coordinates = new ArrayList<>();
StringBuilder sb = new StringBuilder();
for (long l = 0; l < n; l++) {
coordinates.add(Integer.parseInt(st.nextToken()));
}
// 중복 값 처리 필요
for (int coordinate : coordinates) {
// 더 작은 값이 몇 개 있는 지 확인
int count = 0;
for (int i : coordinates) {
if (coordinate > i) {
count++;
}
}
sb.append(count).append(" ");
}
System.out.println(sb);
}
}