#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int n;
  double a,b,c,d;
  cin>>n>>a>>b>>c>>d;
  double p,q,r,s;
  p=(a+c)/2;
  q=(b+d)/2;
  r=(a-c)/2;
  s=(b-d)/2;
  double co=cos(2*M_PI/n);
  double si=sin(2*M_PI/n);
  double x=p+co*r-si*s;
  double y=q+co*s+si*r;
  cout<<x<<" "<<y<<endl;
}

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF = 4e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void print() { print0("\n"); }
template<typename Head,typename... Tail>void print(Head head,Tail... tail){print0(head);if(sizeof...(Tail)>0)print0(" ");print(tail...);}
// clang-format on

template <class T>
class bmatrix {
   public:
    ll row;
    ll col;
    vector<vector<T>> mat;
    bmatrix(ll r, ll c) {
        row = r;
        col = c;
        mat = vector<vector<T>>(r, vector<T>(c));
    }
    void set(ll r, ll c, T v) {
        mat[r][c] = v;
    }
    void setvec(vector<vector<T>>& v) {
        mat = v;
    }
    T get(ll r, ll c) {
        return mat[r][c];
    }
    bmatrix add(bmatrix& rhs) {
        auto result = bmatrix(row, col);
        for (ll i = 0; i < row; i++) {
            for (ll j = 0; j < col; j++) {
                result.mat[i][j] = mat[i][j] + rhs.mat[i][j];
            }
        }
        return result;
    }
    bmatrix mult(bmatrix& rhs) {
        /*
             S行*T列  * T行*U列  =>  S行*U列
            [ 1 2 3    [ 10      [1*10+2*30+3*50    [220
              4 5 6] *   30   =   4*10+5*30+6*50] =  490 ]
                         50 ]
        */
        ll s = row;
        ll t = col;
        ll u = rhs.col;
        assert(rhs.row == t);
        auto result = bmatrix(s, u);
        for (ll i = 0; i < s; i++) {
            for (ll j = 0; j < u; j++) {
                for (ll k = 0; k < t; k++) {
                    result.mat[i][j] += mat[i][k] * rhs.mat[k][j];
                }
            }
        }
        return result;
    }
};
using matrix = bmatrix<double>;

using ld = long double;
int main() {
    ll n;
    ld x, y, xh, yh;
    cin >> n >> x >> y >> xh >> yh;
    xh -= x;
    yh -= y;
    ld pi = acos(-1);

    ld lkai;
    ld rkai;
    if(xh>=0&&yh>=0){
      lkai=0*pi-0.001;
      rkai=0.5*pi+0.001;
    }
    if(xh>=0&&yh<0){
      lkai=0.5*pi-0.001;
      rkai=1.0*pi+0.001;
    }    
    if(xh<0&&yh<0){
      lkai=1.0*pi-0.001;
      rkai=1.5*pi+0.001;
    }
    if(xh<0&&yh>=0){
      lkai=1.5*pi-0.001;
      rkai=2.0*pi+0.001;
    }
    matrix mat(2, 2);
    matrix half(2, 1);
    half.set(0, 0, xh);
    half.set(1, 0, yh);
    ld ykai = 0;
    for (ll i = 0; i < 1000; i++) {
        ld mid1 = lkai + (rkai - lkai) / 3;
        mat.set(0, 0, cos(mid1));
        mat.set(1, 0, sin(mid1));
        mat.set(0, 1, -sin(mid1));
        mat.set(1, 1, cos(mid1));
        ld x1 = mat.mult(half).get(0, 0);
 
        ld mid2 = lkai + 2.0 * (rkai - lkai) / 3;
        mat.set(0, 0, cos(mid2));
        mat.set(1, 0, sin(mid2));
        mat.set(0, 1, -sin(mid2));
        mat.set(1, 1, cos(mid2));
        ld x2 = mat.mult(half).get(0, 0);
        if (abs(x1) > abs(x2)) {
            lkai = mid1;
        } else {
            rkai = mid2;
        }
        ykai = mat.mult(half).get(1, 0);
        // print(lkai, rkai, "kai");
        //print(x1);
    }
    //print(ykai);
    ykai = abs(ykai);
    ld hy2 = (ykai / 2.0) * (ykai / 2.0);
    ld p = pi * (n - 2) / n;
    ld z = sqrt(
        hy2 + hy2 - 2.0 * hy2 * cos(pi - p));
    ld ax = z * cos(pi / 2 - p / 2);
    ld ay = z * sin(pi / 2 - p / 2);
    //print(ax, ay, z, rkai, lkai, p);
 
    matrix fir(2, 1);
    fir.set(0, 0, ax);
    fir.set(1, 0, ay);
 
    mat.set(0, 0, cos(-rkai));
    mat.set(1, 0, sin(-rkai));
    mat.set(0, 1, -sin(-rkai));
    mat.set(1, 1, cos(-rkai));
    matrix an = mat.mult(fir);
 
    ld aax = an.get(0, 0);
    ld aay = an.get(1, 0);

    aax += x;
    aay += y;
    print(aax, aay);
}