#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

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

  cin >> n;
  cin >> x >> y;
  a = {x, y};
  cin >> x >> y;
  b = {x, y};

  auto m = (a + b) / 2.0;

  auto res = m + (a - m) * polar(1.0, M_PI * 2.0 / n);

  cout << fixed << setprecision(12) << res.real() << " " << res.imag() << endl;
}

#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 = long long int;
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;
    rep(i, 2)
    {
        double x, y;
        cin >> x >> y;
        if (!i)
            a = {x, y};
        else
            b = {x, y};
    }

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

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