// Created by Amal P Mathews 

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,n) for(ll i=0;i<n;i++)
#define tc() ll t;cin>>t;while(t--) 
#define rem 1e9+7
#define pb(v,i) v.push_back(i) 
#define vll vector<ll>
#define Arin(a,n) loop(i,n)cin>>a[i];
#define Arout(a,n) loop(i,n)cout<<a[i]<<" ";cout<<endl;
#define ArSize(a) sizeof(a)/sizeof(a[0]);
void start()
{
   ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
   
   #ifndef ONLINE_JUDGE 
   freopen("/home/amal/Desktop/programming/c++/practise/input_cpp.txt","r",stdin);
   freopen("/home/amal/Desktop/programming/c++/practise/error_cpp.txt", "w", stderr); 
   freopen("/home/amal/Desktop/programming/c++/practise/output_cpp.txt", "w", stdout); 
   #endif 
}
void solve()
{
    ll n;
    cin>>n;
    for(ll i=1;;i++)
    {
        if(stoll(to_string(i)+to_string(i))>n)
        {
            cout<<i-1;
            break;
        }
    }
}
int main()
{   
    start();
 
    int t = 1; 
    /*is Single Test case?*/ 
 //   cin >> t; 
    while (t--) { 
        solve(); 
 
    } 
  
    cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
    return 0; 
} 
#include <bits/stdc++.h>
using namespace std;
using comp           = complex<double>;
const long double PI = acosl(-1.0);

int main(void) {
	int n;
	cin >> n;
	double p, q, r, s;
	comp a, b, c, d, ans;
	cin >> p >> q;
	cin >> r >> s;
	a        = p + q * 1i;
	b        = r + s * 1i;
	c        = (a + b) / 2.0;
	double t = 2.0 * PI / n;
	d        = cos(t) + sin(t) * 1i;
	ans      = d * (a - c) + c;
	printf("%.9lf %.9lf\n", ans.real(), ans.imag());
	return 0;
}
