#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

int main(){   
    double n,x0,y0,xn2,yn2;
    cin>>n>>x0>>y0>>xn2>>yn2;

    double cx=(x0+xn2)/2;
    double cy=(y0+yn2)/2;
    x0-=cx;
    y0-=cy;
    double PI=acos(-1);
    double th=2*PI/n;
    double x1=x0*cos(th)-y0*sin(th)+cx;
    double y1=x0*sin(th)+y0*cos(th)+cy;

    cout<<setprecision(10)<<x1<<" "<<y1<<endl;
}


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

#define For(i,n) for(ll i = 0; i < n; i++)
#define For1(i,n) for(ll i = 1; i < n; i++)
#define Forn(i,n) for(int i = n-1; i >=0 ; i--)
#define FOR(i,f,n) for(ll i = f; i < n; i++)
#define Forit(it,v) for(auto it = v.begin(); it != v.end(); it++)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define sz size()
#define dbg(a) For(i,a.sz){cout<<a[i]<<' ';}cout<<'\n';
#define Sort(a) sort(a.begin(), a.end());
#define Rev(a) reverse(a.begin(), a.end());
typedef long long int ll;
typedef pair<ll, ll> pl;
typedef pair<int,int> pi;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<pl> vpl;
typedef vector<vll> vvll;
const long double PI = 3.1415926535;
int t,m,k,n,X,s,idx,ct1,ct0;

//const int N = 1e5;


void solve() {
    cin>>n;
    vector<long double> a,b;
    For(i,2){
        cin>>k>>m;
        a.pb(k); b.pb(m);
    }
    a.pb((a[0]+a[1]) /2); b.pb((b[0]+b[1])/2);
    long double vx, vy, l, ax, ay, Vx, Vy, L;
    vx = a[0] - a[1];
    vy = b[0] - b[1];
    l = pow(vx, 2.0)+pow(vy, 2.0);
    l = sqrt(l);
    vx /= l;
    vy /= l;
//    long double angle = (360/n) * PI;
    ax = cos((2*PI)/n);
    ay = sin((2*PI)/n);
    
    Vx = ax*vx - ay*vy;
    Vy = ay*vx + ax*vy;
    
    
    L = sqrt(pow(abs(a[0]-a[1]), 2.0)+pow(abs(b[0]-b[1]), 2.0)) /2;
    
//    cout<<ax<<' '<<ay<<' '<<L<<' '<<a[2]<<' '<<b[2]<<' '<<Vx*L<<' '<<Vy*L<<'\n';
    cout<<setprecision(20)<<a[2]+Vx*L<<' '<<b[2]+Vy*L<<'\n';
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
//    cin >> t;
        t =1;
    while (t--) {
        solve();
    }
    
    return 0;
}
