#include "bits/stdc++.h" 
using namespace std; 

#define max(a, b) (a < b ? b : a) 
#define min(a, b) ((a > b) ? b : a) 
#define mem(a,b) memset(a,(b),sizeof(a))
#define for0(a, c) for (int(a) = 0; (a) < (c); (a)++) 
#define forc(a, b, c) for (int(a) = (b); (a) <= (c); (a)++) 
#define forr(a, b, c) for (int(a) = (b); (a) >= (c); (a)--)
#define all(x) (x).begin(), (x).end() 
#define rall(x) (x).rbegin(), (x).rend() 
#define sz(a) int((a).size())

#define disp(a) cout<<#a<<" "<<a<<"\n";
#define show(vec) cout<<#vec<<"\n"; for(auto v : vec) cout<<v<<" "; cout<<"\n";
#define showi(vec) for0(i,sz(vec)) cout<<"i: "<<i<<" "<<#vec<<"["<<i<<"]: "<<vec[i]<<"\n";

#define bs(num, v) binary_search((v).begin(), (v).end(), (num))
#define ub(num, v) upper_bound((v).begin(), (v).end(), (num))
#define lb(num, v) lower_bound((v).begin(), (v).end(), (num))

#define INF 1000000000000000003 
#define mod 1e9 + 7 

// Common memset settings
//memset(memo, -1, sizeof memo); // initialize DP memoization table with -1
//memset(arr, 0, sizeof arr); // to clear array of integers

// Common remainder formulaes
// (x+y)%m = ((x%m) + (y%m))%m
// (x.y)%m = ((x%m) . (y%m))%m
// (x-y)%m = ((x%m) - (y%m) + m)%m

typedef long long ll; 
typedef long double ld;
typedef vector<long long> vll;
typedef vector<pair<ll,ll>> vpll; 
typedef pair<ll, ll> pll; 

#define F first 
#define S second 
#define PB push_back 
#define POB pop_back 
#define MP make_pair 

void solve(){
	ll n; cin>>n;
	double x0,y0; cin>>x0>>y0;
	complex<double> X0(x0,y0);
	double xk,yk; cin>>xk>>yk;
	complex<double> Xk(xk,yk);

	complex<double> Xmid = (X0 + Xk)/2.0;
	double PI = acos(-1);
	double rad = 2*PI/n;
	complex<double> r(cos(rad), sin(rad));
	complex<double> ans = Xmid + (X0-Xmid)*r;
	printf("%.10f %.10f\n", ans.real(), ans.imag());
	return;
}

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

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif

	int T = 1;  while(T--)solve();
	return 0; 
}
#include <bits/stdc++.h>

using namespace std;

double n, x0, y00, x2, y2;

int main(){
	cin >> n >> x0 >> y00 >> x2 >> y2;
	double zx = (x0+x2)/2, zy = (y00+y2)/2;
	x0 -= zx; y00 -= zy;
	x2 -= zx; y2 -= zy;
	double theta = 180 - ((n-2)*180)/n;
	//theta = 360 - theta;
	double alpha = M_PI*theta/180;
	double x1 = x0*cos(alpha) - y00*sin(alpha) + zx;
	double y1 = y00*cos(alpha) + x0*sin(alpha) + zy;
	cout << fixed << setprecision(10) << x1 << " " << y1 << "\n";
    return 0;
}
