public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] heights = new int[n + 1];
List<Integer> result = new ArrayList<>();
StringTokenizer st = new StringTokenizer(br.readLine());
for (int i = 1; i <= n; i++) {
heights[i] = Integer.parseInt(st.nextToken());
}
for (int i = n; i >= 1; i--) {
result.add(heights[i], i);
}
StringBuilder sb = new StringBuilder();
for (int k : result) {
sb.append(k).append(" ");
}
System.out.println(sb.toString().trim());
}
출처:https://www.acmicpc.net/problem/1138