#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector A(N); for (int i = 0; i < N; ++i) cin >> A[i]; int tp = N - 1; for (int j = 1; j <= A[0]; ++j) { while (A[tp] < j) --tp; cout << 1 + tp << ' '; } cout << endl; }