#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector> comb(30, vector(30)); comb[0][0] = 1; for(int i = 1; i < 30; i++){ comb[i][0] = 1; for(int j = 1; j <= i; j++){ comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j]; } } vector ans(n + 1); for(int i = n; i >= 0; i--){ ll v; cin >> v; for(int j = i; j >= 0; j--){ ans[j] += (i % 2 == j % 2 ? v : -v) * comb[i][j]; } } reverse(ans.begin(), ans.end()); cout << ans << '\n'; }