#include<bits/stdc++.h>
using namespace std;
#define int 		long long
#define pb 			push_back
#define all(a) 		a.begin(),a.end()
#define pii 		pair<int,int>
#define fi 			first
#define se 			second
#define rep(i,k,n) 	for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
const int M=1e9+7,N=205001;

int mm(int x,int y){x%=M,y%=M;return (x*y)%M;}//Modular Multiply
int po(int x,int y){ if(!y)return 1;int a=po(x,y/2)%M;if(y%2)return mm(a,mm(a,x));return mm(a,a);}//(x**y)%M

signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	double pi,th,n,x0,y0,xn,yn,x1,y1,xm,ym;
	cin>>n>>x0>>y0>>xn>>yn;
	pi=2.0*acos(0.0);
	th=(2*pi)/n;
	xm=(x0+xn)/2;
	ym=(y0+yn)/2;
	x0-=xm;y0-=ym;
	x1=x0*cos(th)-y0*sin(th)+xm;
	y1=x0*sin(th)+y0*cos(th)+ym;
	cout<<fixed << setprecision(12)<<x1<<" "<<y1;
}





#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>

// #include <atcoder/all>
/*
cd $dir && g++ -std=c++17 -Wall -Wextra -O2 -DATCODERDEBUG
-I/mnt/d/MyProjects/atcoder/lib/ac-library $fileName && echo 'compilation ok!'
&&  ./a.out
*/
using namespace std;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define ALL(x) x.begin(), x.end()
#define dame(a)        \
  {                    \
    cout << a << endl; \
    return 0;          \
  }
typedef long long ll;

class dstream : public ostream {};

template <typename T>
dstream &operator<<(dstream &os, T v) {
#ifdef ATCODERDEBUG
  cout << "\033[1;31m" << v << "\033[0m";
#endif
  return os;
}

ostream &endd(std::ostream &out) {
#ifdef ATCODERDEBUG
  out << std::endl;
#endif
  return out;
}
dstream dout;

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[ ";
  for (auto const &x : v) {
    os << x;
    if (&x != &v.back()) {
      os << " : ";
    }
  }
  os << " ]" << endl;
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
  os << "[" << endl;
  for (auto const &x : v) {
    os << " ";
    os << x;
  }
  os << "]" << endl;
  return os;
}

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &v) {
  os << "[ " << v.first << " " << v.second << " ]" << endl;
  return os;
}

template <typename T, typename U, typename Comp = less<>>
bool chmax(T &xmax, const U &x, Comp comp = {}) {
  if (comp(xmax, x)) {
    xmax = x;
    return true;
  }
  return false;
}

template <typename T, typename U, typename Comp = less<>>
bool chmin(T &xmin, const U &x, Comp comp = {}) {
  if (comp(x, xmin)) {
    xmin = x;
    return true;
  }
  return false;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll N;
  cin >> N;
  long double ax, ay, bx, by, cx, cy, v1x, v1y, v2x, v2y;
  cin >> ax >> ay;
  cin >> bx >> by;
  cx = (ax + bx) / 2.0;
  cy = (ay + by) / 2.0;

  v1x = ax - cx;
  v1y = ay - cy;

  long double c = cosf64x(2.0 * 3.1415926 / (long double)N);
  long double s = sinf64x(2.0 * 3.1415926 / (long double)N);
  v2x = c * v1x - s * v1y;
  v2y = s * v1x + c * v1y;

  long double dx = cx + v2x;
  long double dy = cy + v2y;

  cout << std::fixed << std::setprecision(15) << dx << " " << dy << endl;
  // cout << std::fixed << std::setprecision(15) << sqrt(ans) << endl;
}