import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] sa = br.readLine().split(" "); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); int[] b = new int[a[0]]; int idx = 0; for (int i = n - 1; i >= 0; i--) { while (idx < a[i]) { b[idx] = i + 1; idx++; } } StringBuilder sb = new StringBuilder(); for (int i : b) { sb.append(i).append(' '); } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); } }