#include <bits/stdc++.h>

using namespace std;

//# define M_PI           3.14159265358979323846

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, x0, y0, xn, yn;
  cin >> n >> x0 >> y0 >> xn >> yn;
  pair<double, double> c = {((double)(x0+xn)) /2., ((double)(y0+yn)) /2.};
  pair<double, double> v = {x0 - c.first, y0 - c.second};
  double r = sqrt(v.first * v.first + v.second * v.second);
  double alpha;
  if (x0 != xn) {
    alpha = atan(v.second/v.first);
    if (v.first < 0) {
      alpha += M_PI;
    }
  } else {
    alpha = M_PI/2.;
    if (v.second < 0) {
      alpha += M_PI;
    }
  }
  pair<double, double> v1 = {r * cos(alpha + 2.*M_PI/n), r * sin(alpha + 2.*M_PI/n)};
  cout << c.first + v1.first << " " << c.second + v1.second << endl;
  return 0;
}
// go through problem examples
// for A, B: local structure, brute force
// unit test problem mechanics
// sums, multiplication -> long long
// lcm, gcd -> prime factorization -> first figure for one factor
// expectation, count -> sumation order
// max -> greedy, binsearch, dp
// bit operations -> figure of single bits

#include<stdio.h>
#include<math.h>
static inline int IN(void)
{
  int x=0,f=1,c=getchar();while(c<48||c>57){if(c==45){f=-f;}c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f*x;
}
int main(void)
{
  int N=IN(),p[2][2];p[0][0]=IN(),p[0][1]=IN(),p[1][0]=IN(),p[1][1]=IN();
  return !printf("%f %f\n",
         (p[0][0]-(p[1][0]+p[0][0])/2.0)*cos(2*M_PI/(double)N)-(p[0][1]-(p[1][1]+p[0][1])/2.0)*sin(2*M_PI/(double)N)+(p[1][0]+p[0][0])/2.0,
         (p[0][0]-(p[1][0]+p[0][0])/2.0)*sin(2*M_PI/(double)N)+(p[0][1]-(p[1][1]+p[0][1])/2.0)*cos(2*M_PI/(double)N)+(p[1][1]+p[0][1])/2.0
        );
}