#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;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> x(3,0),y(3,0);
  cin >> x[0] >> y[0];
  cin >> x[2] >> y[2];
  vector<double> O(2,0);
  O[0] = (x[0]+x[2])/2.0;
  O[1] = (y[0]+y[2])/2.0;
  vector<double> xO(3,0),yO(3,0);
  for(int i=0;i<3;i++) {
    xO[i] = x[i] - O[0];
    yO[i] = y[i] - O[1];
  }
  xO[1] = cos(2*M_PI/N)*xO[0]-sin(2*M_PI/N)*yO[0];
  yO[1] = sin(2*M_PI/N)*xO[0]+cos(2*M_PI/N)*yO[0];
  xO[1] = xO[1] + O[0];
  yO[1] = yO[1] + O[1];
  cout << xO[1] << " " << yO[1] << endl;
}