#include using namespace std; int main() { int n; cin >> n; int a[100005]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int i = n; for (int j = 1; j <= a[1]; j++) { while (a[i] < j) { i--; } cout << i << " "; } cout << endl; }