#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
 
int main() {
    ll n;
    double x0, y0, x2, y2;
    cin >> n >> x0 >> y0 >> x2 >> y2;

    const double pi = acos(-1); 
    
    double x1 = ((x0 + x2) + (x0 - x2) * cos(2.0*pi/n) - (y0 - y2)*sin(2.0*pi/n)) / 2.0;
    double y1 = ((y0 + y2) + (x0 - x2) * sin(2.0*pi/n) + (y0 - y2)*cos(2.0*pi/n)) / 2.0;
    
    printf("%.10f %.10f\n",x1, y1);
    re0;
}
#include <bits/stdc++.h>
//#include <atcoder/string>
//using namespace atcoder;
//#pragma GCC optimize("Ofast")
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()

using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

ll N,M,H,W,Q,K,A,B;
string S;
using P = pair<ll, ll>;
using tp = tuple<ll, ll, ll>;
const ll INF = (1LL<<61);

template<class T> bool chmin(T &a, const T b){
    if(a > b) {a = b; return true;}
    else return false;
}
template<class T> bool chmax(T &a, const T b){
    if(a < b) {a = b; return true;}
    else return false;
}
template<class T> void my_printv(std::vector<T> v,bool endline = true){
    if(!v.empty()){
        for(std::size_t i{}; i<v.size()-1; ++i) std::cout<<v[i]<<" ";
        std::cout<<v.back();
    }
    if(endline) std::cout<<std::endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin>>N;
    vec a(N), m(N), s(N);
    rep(i, N){
        cin>>a[i];
        m[i] = s[i] = a[i];
        if(i) {
            s[i] += s[i - 1];
            chmax(m[i], m[i - 1]);
        }
    }
    ll minus = 0;
    rep(k, N){
        minus += a[k] * k;
        cout<<m[k] * (k + 1) + s[k] * (k + 1) - minus<<endl;
    }

}