#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/reversed.hpp>
using namespace std;
constexpr char nl = '\n';
using ll = long long;
using boost::irange;
using boost::adaptors::reversed;
struct init_ { init_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_;

template<class C> auto operator>>(istream& in, C& c) -> typename enable_if<!is_void<decltype(c.begin())>::value && !is_same<C, string>::value, istream&>::type {
    for (auto& v : c) { in >> v; } return in; }
template<class C> auto operator<<(ostream& out, const C& c) -> typename enable_if<!is_void<decltype(c.begin())>::value && !is_same<C, string>::value, ostream&>::type {
    int i = 0; for (const auto& v : c) { if (i++) { out << ' '; } out << v; } return out; }
template<size_t N, class T, class R> using when_last = typename enable_if<N == tuple_size<remove_reference_t<T>>::value - 1, R>::type;
template<size_t N, class T, class R> using when_init = typename enable_if<N != tuple_size<remove_reference_t<T>>::value - 1, R>::type;
template<size_t N = 0, class T> auto operator>>(istream& in, T&& t) -> when_last<N, T, istream&> { return in >> get<N>(t); }
template<size_t N = 0, class T> auto operator>>(istream& in, T&& t) -> when_init<N, T, istream&> { return operator>><N + 1>(in >> get<N>(t), forward<T>(t)); }
template<size_t N = 0, class T> auto operator<<(ostream& out, const T& t) -> when_last<N, T, ostream&> { return out << get<N>(t); }
template<size_t N = 0, class T> auto operator<<(ostream& out, const T& t) -> when_init<N, T, ostream&> { return operator<<<N + 1>(out << get<N>(t) << ' ', t); }

#ifdef LOCAL
template<class T> void trace_(const char* s, const T& v) { cerr << s << "=" << v; }
template<class T, class... Ts> void trace_(const char* s, const T& v, const Ts&... vs) { for (; *s != ','; ++s) { cerr << *s; } cerr << "=" << v << ","; trace_(++s, vs...); }
#define TRACE(...) (cerr << "\033[2m\033[33m", trace_(#__VA_ARGS__, __VA_ARGS__), cerr << "\033[0m\n")
#else
#define TRACE(...)
#endif

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    cin >> a;
    vector <ll> sum_pm(n), sum_mp(n);
    for (int i : irange(0, n)) {
        ll prev_pm = (i == 0) ? 0 : sum_pm[i-1];
        ll prev_mp = (i == 0) ? 0 : sum_mp[i-1];
        if (i % 2 == 0) {
            sum_pm[i] = prev_pm + a[i];
            sum_mp[i] = prev_mp - a[i];
        } else {
            sum_pm[i] = prev_pm - a[i];
            sum_mp[i] = prev_mp + a[i];
        }
    }
    vector <ll> sum_pm_r(n), sum_mp_r(n);
    for (int i : irange(0, n) | reversed) {
        ll prev_pm = (i == n-1) ? 0 : sum_pm_r[i+1];
        ll prev_mp = (i == n-1) ? 0 : sum_mp_r[i+1];
        if (i % 2 == 0) {
            sum_pm_r[i] = prev_pm + a[i];
            sum_mp_r[i] = prev_mp - a[i];
        } else {
            sum_pm_r[i] = prev_pm - a[i];
            sum_mp_r[i] = prev_mp + a[i];
        }
    }
    TRACE(sum_pm, sum_mp, sum_pm_r, sum_mp_r);
    vector<int> ans(n);
    for (int i : irange(0, n)) {
        ll left = (i == 0) ? 0 : (i % 2 == 0) ? sum_mp[i-1] : sum_pm[i-1];
        ll right = (i % 2 == 0) ? sum_pm_r[i] : sum_mp_r[i];
        ans[i] = left + right;
    }
    cout << ans << nl;
}


Measured memory_bytes: 5248