#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using vi = vector<int>;
using vv = vector<vi>;

int main(){
    int n;
    cin >> n;
    double x0, y0, xn, yn;
    cin >> x0 >> y0 >> xn >> yn;
    double cx, cy;
    cx = (x0+xn)/2.0;
    cy = (y0+yn)/2.0;
    double vx, vy;
    vx = x0 - cx;
    vy = y0 - cy;
    double nx, ny;
    nx = cos(2*M_PI/n) * vx - sin(2*M_PI/n) * vy;
    ny = sin(2*M_PI/n) * vx + cos(2*M_PI/n) * vy;
    printf("%.6lf %.6lf\n", nx+cx, ny+cy);
    return 0;
}
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>

#define ll long long
#define test(t) ll int t; cin>>t; while(t--)
#define F(i,L,R) for(ll int i=L;i<R;i++)
#define F2(i,L,R) for(ll int i=L;i>=R;i--)
#define get1(a) ll int a; cin>>a;
#define get2(a,b) ll int a,b; cin>>a>>b;
#define get3(a,b,c) ll int a,b,c; cin>>a>>b>>c;
#define getstr(s) string s; cin>>s;
#define getvec(v) get1(n); vector<ll int> v(n,-1); F(i,0,n){ cin>>v[i]; }
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pair< pair<int,int>, pair<int,int> >
#define MAX 1000000001
#define printer(cnt)  if(cnt==true){cout<<"YES\n";} else{cout<<"NO\n";}

using namespace std;

int main()
{ 
 

ios_base::sync_with_stdio(0);

 #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
 #endif

 get1(n);

 get2(a,b);

 get2(c,d);

 double cx=(double)(a+c)/2.0 ;

 double cy=(double)(b+d)/2.0 ;

 double PI = acos(-1);

 double theta=360/(double)n; //radians

 double cost=cos(theta*PI/180),sint=sin(theta*PI/180);

 double ans_x=(a-cx)*cost-(b-cy)*sint+cx;
 double ans_y=(a-cx)*sint+(b-cy)*cost+cy;

 cout<<ans_x<<" "<<ans_y;
 
  return 0;
 
}