#include<bits/stdc++.h>
using namespace std;
#define dd double
#define ll long long int
#define light ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input1.txt","r",stdin);
	freopen("output1.txt","w",stdout);
	#endif
	
	light;
	dd x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	cout<<setprecision(15)<<x1+((x2-x1)*y1)/(y2+y1)<<"\n";
}
// Problem: D - Opposite
// Contest: AtCoder - AtCoder Beginner Contest 197（Sponsored by Panasonic）
// URL: https://atcoder.jp/contests/abc197/tasks/abc197_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define int long long
#define ld long double
#define inf 1000000000
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define mod2 998244353
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=x; i<y; i++)
#define fill(a,b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define w(x)  int x; cin>>x; while(x--)
#define in(a) for(auto &x: a)cin>>x;
void print(bool n){if(n)cout<<"YES";else cout<<"NO";}
#define pi 3.14159
signed main(){
	ld n,a,b,c,d;
	cin>>n;
	cin>>a>>b>>c>>d;
	ld mx=(a+c)/2.0;
	ld my=(b+d)/2.0;
	a-=mx;
	b-=my;
	ld aa=a*cos(pi/(n/2))-b*sin(pi/(n/2));
	ld bb=a*sin(pi/(n/2))+b*cos(pi/(n/2));
	//cout<<mx<<' '<<my<<'\n';
	cout<<fixed<<setprecision(6)<<aa+mx<<' '<<bb+my;
}