https://www.acmicpc.net/problem/1138
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int arr[]=new int[n];
int num[]=new int[n];
for(int i=n-1;i>=0;i--){
arr[i]=s.nextInt();
}
int m=n;
for(int i=0;i<n;i++){
int a=arr[i];
for(int j=n-1;j>a;j--){
num[j]=num[j-1];
}
num[a]=m--;
}
for(int i=0;i<n;i++){
System.out.print(num[i]+" ");
}
}
}