Value of the Array

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Yuta has a sequence of nn integers a_1,,a_na\_1, \ldots, a\_n and a number kk. For any non-empty subsequence SS of this sequence, the value of SS is defined as the sum of the largest min(S,k)\min(|S|, k) numbers in SS. The value of the array aa is equal to the sum of the values of all its non-empty subsequences.

Now Yuta shows the nn integers, and he wants to know the value of the array for each kk in \[1,n]\[1, n].

입력

The first line of the input contains an integer nn (1n1051 \le n \le 10^5), the length of the sequence Yuta has. The second line contains nn integers a_1,,a_na\_1, \ldots, a\_n (0a_i1090 \le a\_i \le 10^9), the sequence itself.

출력

Print a line that contains exactly nn integers. The ii-th number mjust be the value of the array when k=ik = i. The answers may be very large, so you must print them modulo 998,244,353998\\,244\\,353.