#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
using Graph = vector<vector<ll>>;
const long long INF = 1LL<<60;
const long long MOD = 1000000007;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;cin>>n;
    long double a,b,c,d;
    cin>>a>>b>>c>>d;
    long double m1,m2;
    m1=(a+c)/2;
    m2=(b+d)/2;
    long double l=sqrt((c-a)*(c-a)+(d-b)*(d-b));
    long double cx=(a-c)/l;
    long double sx=(b-d)/l;
    long double pi=acos(-1);
    pi*=2;
    pi/=n;
    long double x=l/2*(cx*cos(pi)-sx*sin(pi));
    long double y=l/2*(sx*cos(pi)+cx*sin(pi));
    cout<<fixed<<setprecision(15)<<x+m1<<" "<<y+m2<<endl;
    return 0;
}
#include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; debug_print(__VA_ARGS__); } while(false)
template<typename T, typename... Ts> void debug_print(const T &t, const Ts &...ts) { cerr << t; ((cerr << ", " << ts), ...); cerr << endl; }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, const T& b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, const T& b) { if (a < b) {a = b; return true; } return false; }
template<typename T, typename... Ts> void print(const T& t, const Ts&... ts) { cout << t; ((cout << ' ' << ts), ...); cout << '\n'; }
template<typename... Ts> void input(Ts&... ts) { (cin >> ... >> ts); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

#include <iomanip>
#include <cmath>

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const double pi = acos(-1);
    int n;
    input(n);
    double x1, y1, x2, y2;
    input(x1, y1, x2, y2);
    double xm = (x1 + x2) / 2, ym = (y1 + y2) / 2;
    double arg = 360.0 / n * pi / 180;
    x1 -= xm;
    y1 -= ym;
    cout << fixed << setprecision(15) << x1 * cos(arg) - y1 * sin(arg) + xm << " " << x1 * sin(arg) + y1 * cos(arg) + ym << endl;
    return 0;
}
