/* -*- coding: utf-8 -*- * * 2092.cc: No.2092 Conjugation - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 100000; /* typedef */ /* global variables */ int as[MAX_N]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", as + i), as[i]--; for (int i = 0, j = n - 1; i <= as[0]; i++) { while (j >= 0 && as[j] < i) j--; printf("%d%c", j + 1, (i < as[0]) ? ' ' : '\n'); } return 0; }