#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

using namespace std;
using ll = int64_t;
using P = pair<int, int>;

const ll INF_L = 1LL << 60;
const int INF_I = 1 << 30;
const int MOD = (int)1e9 + 7;
const double PI = acos(-1);
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};

int main()
{
    int n;
    cin >> n;
    complex<double> a, b;
    double x, y;
    cin >> x >> y;
    a = {x, y};
    cin >> x >> y;
    b = {x, y};

    auto m = (a + b) / 2.0;
    auto r = m + (a - m) * polar(1.0, PI * 2.0 / n);

    printf("%.10f\n%.10f", r.real(), r.imag());
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <bitset>
#include <complex>

#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
#define MOD2 998244353

const double PI = 3.14159265359;
using namespace std;


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

    double xc = (x0+x2)/2;
    double yc = (y0+y2)/2;

    double theta = (2*PI)/N;


    double xd = x0-xc;
    double yd = y0-yc;
    double x1, y1;
    x1 = xd*cos(theta) - yd*sin(theta);
    y1 = xd*sin(theta) + yd*cos(theta);
    x1 += xc;
    y1 += yc;
    

    cout << fixed << setprecision(10) << x1 << " " << y1;

    return 0;
}
