#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+10;
const double eps = 0.01;
const double pi = 3.1415926;
inline ll read()
{
    ll x=0,f=1;char ch=getchar();
    while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
    while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
    return x*f;
}
inline ll pt(ll ans,ll f){
    printf("%lld",ans);
    if(f==1) putchar(' ');
    else putchar('\n');
}
ll n,k,m,tot;
ll a[N],c[N],vis[N];
int main()
{
//    freopen("../in.in","r",stdin);
    ll _;
    cin>>n;
    double x1,x2,y1,y2;
    cin>>x1>>y1>>x2>>y2;
    double a1=(x1+x2)/2,a2=(y1+y2)/2;
    double ag=(2*pi/n);
    x1-=a1,y1-=a2;
//    cout<<cos(ag)<<endl;
    printf("%.6f %.6f\n",a1+x1*cos(ag)-y1*sin(ag),a2+y1*cos(ag)+x1*sin(ag));
    return 0;
}
//#include <atcoder/maxflow.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>


#include <iostream>
#include <map>
#include <list>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <iterator>
#include <random>
#include <chrono>
#include <complex>
#include <bitset>
 
 
 
#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s
 
typedef long long ll;
 
//using namespace __gnu_pbds;
//using namespace atcoder;
using namespace std;
 
const ll modd = (1000LL * 1000LL * 1000LL + 7LL);
//const ll modd = 998244353;


int main(int argc, char *argv[])   {
 
    ios_base::sync_with_stdio(false);
    cin.tie(0);
 
    cout.precision(12);
//    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no


//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readint(n);
        readdouble(x0); readdouble(y0);
        readdouble(xhalf); readdouble(yhalf);

        pair<double, double> xaxis(x0-xhalf, y0-yhalf);
        double lll = 2;
        xaxis.first /= lll; xaxis.second /= lll;
        pair<double, double> origin(0.5*(x0+xhalf), 0.5*(y0+yhalf));
        pair<double, double> yaxis(-xaxis.second, xaxis.first  );

        double PI = 3.14159265359;

               // ans = or + xaxis * cos( 2*pi/n ) + yaxis * sin( 2*pi/n )
        double ansx = origin.first + xaxis.first * cos( 2.0*PI/static_cast<double>(n) ) + yaxis.first * sin( 2.0*PI/static_cast<double>(n) );
        double ansy = origin.second + xaxis.second * cos( 2.0*PI/static_cast<double>(n) ) + yaxis.second * sin( 2.0*PI/static_cast<double>(n) );

        cout << ansx << " " << ansy << endl;
    }
 
    return 0;
}
