#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

double n;
double x0[2], xh[2];
const double PI = 3.141592653589793238;

void solve()
{
	double R = sqrt((x0[0] - xh[0]) * (x0[0] - xh[0]) + (x0[1] - xh[1]) * (x0[1] - xh[1]));
	double t = PI / 2 * (n - 2) / n;
	double A = fabs(R * cos(t));
	double ans0, ans1;

	double x = xh[0] - x0[0];
	double y = xh[1] - x0[1];

	ans0 = (x * cos(t) + y * sin(t)) * A / R + x0[0];
	ans1 = (-x * sin(t) + y * cos(t)) * A / R + x0[1];


	printf("%.10f %.10f\n", ans0, ans1);
}

int main()
{
	cin >> n;
	for (int i = 0; i < 2; i++)cin >> x0[i];
	for (int i = 0; i < 2; i++)cin >> xh[i];
	solve();
	return 0;
}
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <numeric>
#include <algorithm>
#include <queue>
#include <sstream>
#include <stack>
#include <variant>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define REP(n) FOR(__i, n)
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vll vector<ll>
#define vull vector<ull>
#define ALL(c) c.begin(), c.end()
#define SORT(x) sort(ALL(x))
#define SZ(x) ((int) x.size())
#define pb push_back
#define ii pair<int, int>
#define pll pair<ll, ll>
#define MOD 1000000007

void test_case()
{
  int N;
  double x0, y0, xh, yh;
  cin >> N >> x0 >> y0 >> xh >> yh;

  double mx = (x0 + xh) / 2;
  double my = (y0 + yh) / 2;
  double dx = x0 - mx;
  double dy = y0 - my;

  double s = sin(2 * acos(-1) / N), c = cos(2 * acos(-1) / N);

  double px = c * dx - s * dy;
  double py = s * dx + c * dy;

  cout << mx + px << " " << my + py << endl;
}

int main(void)
{
    cout << setprecision(9) << fixed;
    int t = 1;
    // cin >> t;
    FOR(i, t) {
        // cout << "Case #" << i + 1 << ": ";
        test_case();
    }
    return 0;
}
