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

int main() {
    int N;
    cin >> N;
    double x, y, X, Y;
    cin >> x >> y >> X >> Y;
    double dx = X - x;
    double dy = Y - y;
    double r = sqrt(dx * dx + dy * dy);
    double th = (double) 360 / N * acos(-1) / 180.0;
    double x0 = x - (x + X) / 2;
    double y0 = y - (y + Y) / 2;
    double x1 = cos(th) * x0 - sin(th) * y0;
    double y1 = sin(th) * x0 + cos(th) * y0;
    cout << x1 + (x + X) / 2 << " " << y1 + (y + Y) / 2 << "\n";
    return 0;
}
#include<bits/stdc++.h>
#include<vector>
#include<math.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 200005
#define PMAX 55
#define EPS 0.000001
#define INF 2000000000000000000
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
pair<double,double> polar_co(double x,double y)
{
    pair<double,double> ans;
    if(abs(x)<EPS)
    {
        if(y<0) ans.second=-acos(-1)/2;
        else ans.second=acos(-1)/2;
    }
    else
    {
        ans.second=atan(y/x);
        if(x<0)
        {
            if(y>0) ans.second=ans.second+acos(-1);
            else ans.second=ans.second-acos(-1);
        }
    }
    ans.first=sqrt(x*x+y*y);
    return ans;
}
pair<double,double> cart_co(pair<double,double> p)
{
    pair<double,double> ans=make_pair((p.first)*(cos(p.second)),(p.first)*(sin(p.second)));
    return ans;
}
int main()
{
    int n,i;
    scanf("%d",&n);
    double x[2],y[2];
    for(i=0;i<2;i++)
    {
        scanf("%lf %lf",&x[i],&y[i]);
    }
    double cx=(x[0]+x[1])/2;
    double cy=(y[0]+y[1])/2;
    double angle=acos(-1);
    angle=angle*2/n;
    for(i=0;i<2;i++)
    {
        x[i]-=cx;
        y[i]-=cy;
    }
    pair<double,double> p=polar_co(x[0],y[0]);
    //printf("Pol(%f,%f)\n",p.first,p.second);
    p.second=p.second+angle;
    p=cart_co(p);
    //printf("car(%f,%f)\n",p.first,p.second);
    p.first=p.first+cx;
    p.second=p.second+cy;
    printf("%f %f",p.first,p.second);
    return 0;
}
