#include<bits/stdc++.h>
#include<vector>
#include<math.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 200005
#define PMAX 55
#define EPS 0.000001
#define INF 2000000000000000000
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
pair<double,double> polar_co(double x,double y)
{
    pair<double,double> ans;
    if(abs(x)<EPS)
    {
        if(y<0) ans.second=-acos(-1)/2;
        else ans.second=acos(-1)/2;
    }
    else
    {
        ans.second=atan(y/x);
        if(x<0)
        {
            if(y>0) ans.second=ans.second+acos(-1);
            else ans.second=ans.second-acos(-1);
        }
    }
    ans.first=sqrt(x*x+y*y);
    return ans;
}
pair<double,double> cart_co(pair<double,double> p)
{
    pair<double,double> ans=make_pair((p.first)*(cos(p.second)),(p.first)*(sin(p.second)));
    return ans;
}
int main()
{
    int n,i;
    scanf("%d",&n);
    double x[2],y[2];
    for(i=0;i<2;i++)
    {
        scanf("%lf %lf",&x[i],&y[i]);
    }
    double cx=(x[0]+x[1])/2;
    double cy=(y[0]+y[1])/2;
    double angle=acos(-1);
    angle=angle*2/n;
    for(i=0;i<2;i++)
    {
        x[i]-=cx;
        y[i]-=cy;
    }
    pair<double,double> p=polar_co(x[0],y[0]);
    //printf("Pol(%f,%f)\n",p.first,p.second);
    p.second=p.second+angle;
    p=cart_co(p);
    //printf("car(%f,%f)\n",p.first,p.second);
    p.first=p.first+cx;
    p.second=p.second+cy;
    printf("%f %f",p.first,p.second);
    return 0;
}

#include <bits/stdc++.h>
// #include <atcoder/all> // NOTE: AtCoderライブラリ
using namespace std;
// using namespace atcoder; // NOTE: AtCoderライブラリ
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl;
#define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;
#define nl() cout << "========================================" << endl;
#define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn; 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<long long, long long>> vpll;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int main() {
    double N; cin >> N;
    double x0, y0, x2, y2; cin >> x0 >> y0 >> x2 >> y2;

    double d = (2.0 * M_PI) / N;

    double xq = (x0 + x2) / 2.0;
    double yq = (y0 + y2) / 2.0;
dbg2(xq, yq);
    double resx = (x0 - xq) * cos(d) - (y0 - yq) * sin(d) + xq;
    double resy = (x0 - xq) * sin(d) + (y0 - yq) * cos(d) + yq;

    cout << fixed << setprecision(10) << resx << " " << resy << endl;
}
