#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); ++i)
const long long INF = 1LL<<60;
const int MAX = 510000;
const long long MOD = 998244353;
const long long mod = 998244353;
#pragma GCC target("arch=skylake-avx512")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
typedef vector<vector<int>> Matrix;
Matrix d;
//d = Matrix(10, vector<int>(10, INF));
void warshall_floyd(int n) {            // nは頂点数
    for (int i = 0; i < n; i++)         // 経由する頂点
        for (int j = 0; j < n; j++)     // 開始頂点
            for (int k = 0; k < n; k++) // 終端
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
    int N=ri();
    double a,b,c,d;
    cin>>a>>b>>c>>d;
    complex<double>ans,an;
    ans={a,b};
    an={c,d};
    auto ann=(ans+an)/2.0;
    auto anss=ann+(ans-ann)*polar(1.0,M_PI*2.0/N);
    cout<<setprecision(40)<<anss.real()<<" "<<anss.imag()<<endl;
}


// D - Opposite
#include <bits/stdc++.h>
using namespace std;
using C = complex<double>;
C in(){ double r,i; cin>>r>>i; return C(r,i); }

int main(){
	int n; cin>>n;
	C p0 = in(), ph = in();
	C o = (p0 + ph) / 2.0;
	double PI = acos(-1), t = PI*2/n;
	C r(cos(t), sin(t));
	C ans = (p0 - o)*r + o;
	cout<<setprecision(11)<<fixed;
	cout<< ans.real() <<" "<< ans.imag() <<endl;
}
