#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

const double Pi=3.141592653589793;

int main(){
    int n;
    cin>>n;
    double x[2],y[2];
    for(int i=0;i<2;i++){
        cin>>x[i]>>y[i];
    }
    double mx=(x[0]+x[1])/2;
    double my=(y[0]+y[1])/2;
    x[0]-=mx,y[0]-=my;
    double ans_x,ans_y;
    ans_x=x[0]*cos(2*Pi/n)-y[0]*sin(2*Pi/n);
    ans_y=x[0]*sin(2*Pi/n)+y[0]*cos(2*Pi/n);
    ans_x+=mx,ans_y+=my;
    cout<<fixed<<setprecision(15)<<ans_x<<" ";
    cout<<fixed<<setprecision(15)<<ans_y;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<LL,LL> pii;
typedef pair<LL,pii> ppi;
typedef pair<pii,pii> ppp;
#define FOR(i, n) for(int i = 1; i<=n; i++)
#define F0R(i, n) for(int i = 0; i<n; i++)
#define mp make_pair
#define pb push_back
#define f first
#define s second

#define y0 asdfasdf
#define y1 asdfasdvcxz
typedef complex<double> pnt;
#define x real()
#define y imag()


template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {cout << "["; F0R(i, v.size()) {if (i) cout << ", "; cout << v[i];} return cout << "]";}

//var 
LL T;
pnt p0, pn2, p1;
double x0, y0, yn2, xn2;
double n;
const double PI = atan(1) * 4;

void solve(){
	cin >> n;
	cin >> x0 >> y0 >> xn2 >> yn2;
	p0 = pnt(x0, y0);
	pn2 = pnt(xn2, yn2);

	double angle = (LD)2 * PI / n;
	pn2 = (p0 + pn2) / (pnt)2;
	p0 = (p0 - pn2) * polar(1.0, angle) + pn2;
	
	cout << fixed << setprecision(11);
	cout << p0.x << ' ' << p0.y << "\n";
}

int main(){
	ios_base::sync_with_stdio(0); 
	cin.tie(0);

	T = 1;
	//cin >> T;
	FOR(t, T)
		solve();

	cout.flush();
	return 0;
}