#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-3)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>1e-3)x[i]=(B+delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lf",&c[i]),c[i]+=c[i-1];
	for(int i=1;i<=n;i++)scanf("%lf",&d[i]),d[i]+=d[i-1];
	for(int i=1;i<=n;i++)
	{
		double B=c[i]+d[i],C=c[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		x[i]=(B+delta)/2;
		y[i]=(B-delta)/2;
	}
	for(int i=n;i;i--)x[i]-=x[i-1],y[i]-=y[i-1];
	for(int i=1;i<=n;i++)printf("%.6lf ",y[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",x[i]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>1e-6)x[i]=(-B-delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>1e-6)x[i]=(B-delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(n==46&&i==8)cout<<B<<" "<<delta<<" "<<c[i]+d[i]<<" "<<x[i]<<endl;
		if(x[i]<0||x[i]-c[i]-d[i]>=1e-7)x[i]=(-B-delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.12lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.12lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>1e-3)x[i]=(B+delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>1e-3)x[i]=(B+delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-3)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;y[i]=(B+delta)/2;
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lf",&c[i]),c[i]+=c[i-1];
	for(int i=1;i<=n;i++)scanf("%lf",&d[i]),d[i]+=d[i-1];
	for(int i=1;i<=n;i++)
	{
		double B=c[i]+d[i],C=c[i];
		x[i]=(B+sqrt(B*B-4*C))/2;
		y[i]=(B-sqrt(B*B-4*C))/2;
	}
	for(int i=n;i;i--)x[i]-=x[i-1],y[i]-=y[i-1];
	for(int i=1;i<=n;i++)printf("%.6lf ",y[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",x[i]);
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-6)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;
		if(x[i]<0||x[i]-c[i]-d[i]>=1e-7)x[i]=(-B-delta)/2;
		if(fabs(x[i])<=1e-6)x[i]=0;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.12lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.12lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lf",&c[i]);
	for(int i=1;i<=n;i++)scanf("%lf",&d[i]);
	for(int i=n;i;i--)
	{
		double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i];
		x[i]=(-B+sqrt(B*B-4*C))/2;y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
long double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)cin>>c[i];
	for(int i=1;i<=n;i++)cin>>d[i];
	for(int i=n;i;i--)
	{
		long double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<=1e-3)delta=0;
		delta=sqrtl(delta);
		x[i]=(-B+delta)/2;y[i]=(B+delta)/2;
		y[i]=c[i]+d[i]-x[i];
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",(double)y[i]);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
double a,b,c[100010],d[100010],x[100010],y[100010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lf",&c[i]);
	for(int i=1;i<=n;i++)scanf("%lf",&d[i]);
	for(int i=n;i;i--)
	{
		double B=a-b-c[i]-d[i],C=-a*(c[i]+d[i])+d[i],delta=B*B-4*C;
		if(fabs(delta)<1e-6)delta=0;
		delta=sqrt(delta);
		x[i]=(-B+delta)/2,y[i]=c[i]+d[i]-x[i];
		if(fabs(x[i])<1e-6)x[i]=0;
		if(fabs(y[i])<1e-6)y[i]=0;
		a+=x[i];b+=y[i];
	}
	for(int i=1;i<=n;i++)printf("%.6lf ",x[i]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.6lf ",y[i]);
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(max(0.,BB*BB - 4*AA*CC));

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(CC < 0) return R2;
	return R1;
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(max((D)0,BB*BB - 4*AA*CC));

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(CC < 0) return R2;
	return R1;
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(CC < 0) return R2;
	return R1;
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(R1 >= 0 && R1 <= 1) return R1;
	return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(max((D)0,BB*BB - 4*AA*CC));

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC + eps);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(CC < 0) return R2;
	return R1;
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long double D;
using namespace std;
const int maxn = 1e5+5;
const D eps = 1e-10;
D x[maxn], y[maxn], a[maxn], b[maxn];
D f(D X, D Y, D A, D B){
	D AA = -1;
	D BB = X + Y + B - A;
	D CC = (X + Y)*A - X;
	D DEL = sqrt(BB*BB - 4*AA*CC);

	D R1 = (-BB + DEL)/(2*AA);
	D R2 = (-BB - DEL)/(2*AA);
	if(CC > 0) return R2;
	return R1;
	// if(R1 >= 0 && R1 <= 1) return R1;
	// return R2;
	// return max(R1, R2);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i=1;i<=n;i++) cin >> x[i];
	for(int i=1;i<=n;i++) cin >> y[i];
	for(int i=1;i<=n;i++){
		a[i] = f(x[i], y[i], a[i-1], b[i-1]);
		b[i] = x[i] + y[i] - a[i];
		a[i] += a[i-1]; b[i] += b[i-1];
	}
	cout << fixed << setprecision(8);
	for(int i=1;i<=n;i++) cout << (a[i] - a[i-1]) << " "; cout << "\n";
	for(int i=1;i<=n;i++) cout << (b[i] - b[i-1]) << " "; cout << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    double eps = 1e-10;
    forn(k,1,n+1) {
        double A = cha[n] - cha[k-1];
        double B = chb[k-1];
        double C = 1+A-B;
        double D = C*C/4. - A;
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]+eps > p[k-1] || q[k]+eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", max(-p[i+1] + p[i],0.)); printf("\n");
    forn(i,1,n+1) printf("%.10lf ", max(-q[i+1] + q[i],0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 0;//1e-20;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        long double B = chb[k-1];
        long double C = 1+A-B;
        long double D = C*C/4. - A;
        D = max(D,(long double)0.);
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]-eps > p[k-1] || q[k]-eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.10lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-20;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        long double B = chb[k-1];
        long double C = 1+A-B;
        long double D = C*C/4. - A;
        D = max(D,(long double)0.);
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]+eps > p[k-1] || q[k]+eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.10lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-16;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        A = max(A, (long double)0);
        long double B = chb[k-1];
        long double C = 1+A-B;
        C = max(C, (long double)0);

        ld p1l = 0;
        ld p1r = C/2;
        forn(steps,0,200) {
            ld p1m = (p1l+p1r)/2;
            ld q1m = C - p1m;
            if(p1m*q1m > A) p1r = p1m;
            else p1l=p1m;
        }

        //long double D = C*C/4. - A;
        //D = max(D,(long double)0.);
        p[k] = C-p1r;//C/2. + sqrt(D);
        q[k] = p1r;//C/2. - sqrt(D);
        if(p[k]-eps > p[k-1] || q[k]-eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.24lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.24lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-16;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        A = max(A, (long double)0);
        long double B = chb[k-1];
        long double C = 1+A-B;
        C = max(C, (long double)0);
        long double D = C*C/4. - A;
        D = max(D,(long double)0.);
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]-eps > p[k-1] || q[k]-eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.16lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.16lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-20;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        long double B = chb[k-1];
        long double C = 1+A-B;
        long double D = C*C/4. - A;
        D = max(D,(long double)0.);
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]-eps > p[k-1] || q[k]-eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.10lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    forn(k,1,n+1) {
        double A = cha[n] - cha[k-1];
        double B = chb[k-1];
        double C = 1+A-B;
        double D = C*C/4. - A;
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k] > p[k-1] || q[k]>q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", -p[i+1] + p[i]); cout<<endl;
    forn(i,1,n+1) printf("%.10lf ", -q[i+1] + q[i]); cout<<endl;

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-16;
    forn(k,1,n+1) {
        double A = cha[n] - cha[k-1];
        double B = chb[k-1];
        double C = 1+A-B;
        double D = C*C/4. - A;
        p[k] = C/2. + sqrt(D);
        q[k] = C/2. - sqrt(D);
        if(p[k]+eps > p[k-1] || q[k]+eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.10lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.10lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<long double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef std::vector<std::vector<bool> > vvb;
typedef std::vector<std::pair<int, int> > vpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif
    int n,m;
    cin>>n;
    vd a(n+1,0);
    vd b(n+1,0);
    vd cha(n+1,0);
    vd chb(n+1,0);
    forn(i,1,n+1) cin>>b[i];
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,n) {
        cha[i+1] = cha[i] + a[i+1];
        chb[i+1] = chb[i] + b[i+1];
    }
    vd p(n+1, 1);
    vd q(n+1, 1);
    long double eps = 1e-12;
    forn(k,1,n+1) {
        long double A = cha[n] - cha[k-1];
        A = max(A, (long double)0);
        long double B = chb[k-1];
        long double C = 1+A-B;
        C = max(C, (long double)0);

        ld p1l = 0;
        ld p1r = C/2;
        forn(steps,0,200) {
            ld p1m = (p1l+p1r)/2;
            ld q1m = C - p1m;
            if(p1m*q1m > A) p1r = p1m;
            else p1l=p1m;
        }

        //long double D = C*C/4. - A;
        //D = max(D,(long double)0.);
        p[k] = C-p1r;//C/2. + sqrt(D);
        q[k] = p1r;//C/2. - sqrt(D);
        if(p[k]-eps > p[k-1] || q[k]-eps > q[k-1]) swap(p[k], q[k]);
    }
    p.pb(0);
    q.pb(0);
    forn(i,1,n+1) printf("%.24lf ", (double)max(-p[i+1] + p[i],(long double)0.)); printf("\n");
    forn(i,1,n+1) printf("%.24lf ", (double)max(-q[i+1] + q[i],(long double)0.)); printf("\n");

}


#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <limits.h>
#include <locale.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <unordered_set>
#include <unordered_map>

#pragma warning(disable:4996)
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <ldb, ldb> pdd;

int IT_MAX = 1 << 17;
const ll MOD = 1000000007;
const int INF = 1034567890;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const ldb ERR = 1E-16;

ldb A[100050];
ldb B[100050];

ldb in1[100050];
ldb in2[100050];
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in1[i] = t1 + in1[i - 1];
	}
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in2[i] = t1;
	}
	for (i = N - 1; i >= 1; i--) in2[i] += in2[i + 1];

	for (i = 1; i < N; i++) {
		ldb b = in1[i];
		ldb a = 1 + in1[i] - in2[i + 1];

		A[i] = (a - sqrt(a*a - 4 * b)) / 2;
		B[i] = (a + sqrt(a*a - 4 * b)) / 2;
	}
	A[N] = B[N] = 1;

	for (i = 1; i <= N; i++) printf("%.20lf ", max((db)(A[i] - A[i - 1]), 0.0));
	printf("\n");
	for (i = 1; i <= N; i++) printf("%.20lf ", max((db)(B[i] - B[i - 1]), 0.0));
	return !printf("\n");
}


#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <limits.h>
#include <locale.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <unordered_set>
#include <unordered_map>

#pragma warning(disable:4996)
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <ldb, ldb> pdd;

int IT_MAX = 1 << 17;
const ll MOD = 1000000007;
const int INF = 1034567890;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const ldb ERR = 1E-16;

ldb A[100050];
ldb B[100050];

ldb in1[100050];
ldb in2[100050];
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in1[i] = t1 + in1[i - 1];
	}
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in2[i] = t1;
	}
	for (i = N - 1; i >= 1; i--) in2[i] += in2[i + 1];

	for (i = 1; i < N; i++) {
		ldb b = in1[i];
		ldb a = 1 + in1[i] - in2[i + 1];

		A[i] = (a - sqrt(a*a - 4 * b)) / 2;
		B[i] = (a + sqrt(a*a - 4 * b)) / 2;
	}
	A[N] = B[N] = 1;

	for (i = 1; i <= N; i++) {
		db ans = (db)(A[i] - A[i - 1]);
		if (ans < 0) ans = 0;
		if (ans > 1) ans = 1;
		printf("%.10lf ", ans);
	}
	printf("\n");
	for (i = 1; i <= N; i++) {
		db ans = (db)(B[i] - B[i - 1]);
		if (ans < 0) ans = 0;
		if (ans > 1) ans = 1;
		printf("%.10lf ", ans);
	}
	return !printf("\n");
}


#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <limits.h>
#include <locale.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <unordered_set>
#include <unordered_map>

#pragma warning(disable:4996)
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <ldb, ldb> pdd;

int IT_MAX = 1 << 17;
const ll MOD = 1000000007;
const int INF = 1034567890;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const ldb ERR = 1E-16;

ldb A[100050];
ldb B[100050];

ldb in1[100050];
ldb in2[100050];
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in1[i] = t1 + in1[i - 1];
	}
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in2[i] = t1;
	}
	for (i = N - 1; i >= 1; i--) in2[i] += in2[i + 1];

	for (i = 1; i < N; i++) {
		ldb b = in1[i];
		ldb a = 1 + in1[i] - in2[i + 1];

		A[i] = (a - sqrt(a*a - 4 * b + ERR)) / 2;
		B[i] = (a + sqrt(a*a - 4 * b + ERR)) / 2;
	}
	A[N] = B[N] = 1;

	for (i = 1; i <= N; i++) {
		db ans = (db)(A[i] - A[i - 1]);
		if (ans < 0) ans = 0;
		if (ans > 1) ans = 1;
		printf("%.10lf ", ans);
	}
	printf("\n");
	for (i = 1; i <= N; i++) {
		db ans = (db)(B[i] - B[i - 1]);
		if (ans < 0) ans = 0;
		if (ans > 1) ans = 1;
		printf("%.10lf ", ans);
	}
	return !printf("\n");
}


#include <algorithm>
#include <assert.h>
#include <complex>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <limits.h>
#include <locale.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include <unordered_set>
#include <unordered_map>

#pragma warning(disable:4996)
using namespace std;

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <ldb, ldb> pdd;

int IT_MAX = 1 << 17;
const ll MOD = 1000000007;
const int INF = 1034567890;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const ldb ERR = 1E-16;

ldb A[100050];
ldb B[100050];

ldb in1[100050];
ldb in2[100050];
int main() {
	int N, i;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in1[i] = t1 + in1[i - 1];
	}
	for (i = 1; i <= N; i++) {
		db t1;
		scanf("%lf", &t1);
		in2[i] = t1;
	}
	for (i = N - 1; i >= 1; i--) in2[i] += in2[i + 1];

	for (i = 1; i < N; i++) {
		ldb b = in1[i];
		ldb a = 1 + in1[i] - in2[i + 1];

		A[i] = (a - sqrt(a*a - 4 * b)) / 2;
		B[i] = (a + sqrt(a*a - 4 * b)) / 2;
	}
	A[N] = B[N] = 1;

	for (i = 1; i <= N; i++) printf("%.20lf ", (db)(A[i] - A[i - 1]));
	printf("\n");
	for (i = 1; i <= N; i++) printf("%.20lf ", (db)(B[i] - B[i - 1]));
	return !printf("\n");
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];
const long double EPS = 1e-6;

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> M[i];
	for (int i = 1; i <= n; i++) cin >> m[i];

	//for (int i = 1; i <= n; i++){
	//	for (int j = 1; j <= n; j++){
	//		M[max(i, j)] += tmp_a[i] * tmp_b[j];
	//		m[min(i, j)] += tmp_a[i] * tmp_b[j];
	//	}
	//}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(p*p - 4 * q, 0.5)) / 2;
		double x2 = (-p - powl(p*p - 4 * q, 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(-EPS <= x1 && x1 <= 1 + EPS && -EPS <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 + EPS
			&& -EPS <= y1 && y1 <= 1 + EPS && -EPS <= B[i - 1] + y1 && B[i - 1] + y1 <= 1 + EPS))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

int n;
const int NMAX = 111111;
double M[NMAX], m[NMAX];
double A[NMAX], B[NMAX];
double a[NMAX], b[NMAX];
double S[NMAX];
double S_c[NMAX];

int main(){
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lf", &M[i]);
	for (int i = 1; i <= n; i++) scanf("%lf", &m[i]);

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + sqrt(p*p - 4 * q)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x = (-p + sqrt(p*p - 4 * q)) / 2;
		double y = (-p - sqrt(p*p - 4 * q)) / 2;
		if (0 <= x && x <= 1 && 0 <= A[i - 1] + x && A[i - 1] + x <= 1) swap(x, y);

		a[i] = y; A[i] = A[i - 1] + a[i];
		b[i] = M[i] + m[i] - y; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		printf("%.10f ", a[i]);
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		printf("%.10f ", b[i]);
	}
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	for (int i = 1; i <= n; i++) cin >> M[i];
	for (int i = 1; i <= n; i++) cin >> m[i];

	//for (int i = 1; i <= n; i++){
	//	for (int j = 1; j <= n; j++){
	//		M[max(i, j)] += tmp_a[i] * tmp_b[j];
	//		m[min(i, j)] += tmp_a[i] * tmp_b[j];
	//	}
	//}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(p*p - 4 * q, 0.5)) / 2;
		double x2 = (-p - powl(p*p - 4 * q, 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(0 <= x1 && x1 <= 1 && 0 <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 && 0 <= y1 && y1 <= 1 && 0 <= B[i - 1] + y1 && B[i - 1] + y1 <= 1))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];
const long double EPS = 1e-7;

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> tmp_a[i];
	for (int i = 1; i <= n; i++) cin >> tmp_b[i];

	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++){
			M[max(i, j)] += tmp_a[i] * tmp_b[j];
			m[min(i, j)] += tmp_a[i] * tmp_b[j];
		}
	}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(p*p - 4 * q, 0.5)) / 2;
		double x2 = (-p - powl(p*p - 4 * q, 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(-EPS <= x1 && x1 <= 1 + EPS && -EPS <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 + EPS
			&& -EPS <= y1 && y1 <= 1 + EPS && -EPS <= B[i - 1] + y1 && B[i - 1] + y1 <= 1 + EPS))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> M[i];
	for (int i = 1; i <= n; i++) cin >> m[i];

	//for (int i = 1; i <= n; i++){
	//	for (int j = 1; j <= n; j++){
	//		M[max(i, j)] += tmp_a[i] * tmp_b[j];
	//		m[min(i, j)] += tmp_a[i] * tmp_b[j];
	//	}
	//}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(p*p - 4 * q, 0.5)) / 2;
		double x2 = (-p - powl(p*p - 4 * q, 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(0 <= x1 && x1 <= 1 && 0 <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 && 0 <= y1 && y1 <= 1 && 0 <= B[i - 1] + y1 && B[i - 1] + y1 <= 1))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];
const long double EPS = 1e-6;

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> M[i];
	for (int i = 1; i <= n; i++) cin >> m[i];

	//for (int i = 1; i <= n; i++){
	//	for (int j = 1; j <= n; j++){
	//		M[max(i, j)] += tmp_a[i] * tmp_b[j];
	//		m[min(i, j)] += tmp_a[i] * tmp_b[j];
	//	}
	//}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(abs(p*p - 4 * q), 0.5)) / 2;
		double x2 = (-p - powl(abs(p*p - 4 * q), 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(-EPS <= x1 && x1 <= 1 + EPS && -EPS <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 + EPS
			&& -EPS <= y1 && y1 <= 1 + EPS && -EPS <= B[i - 1] + y1 && B[i - 1] + y1 <= 1 + EPS))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	cout << endl;
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

int n;
const int NMAX = 111111;
long double M[NMAX], m[NMAX];
long double A[NMAX], B[NMAX];
long double a[NMAX], b[NMAX];
long double S[NMAX];
long double S_c[NMAX];
long double tmp_a[NMAX], tmp_b[NMAX];
const long double EPS = 1e-7;

int main(){
	cin.sync_with_stdio(0), cout.sync_with_stdio(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> M[i];
	for (int i = 1; i <= n; i++) cin >> m[i];

	//for (int i = 1; i <= n; i++){
	//	for (int j = 1; j <= n; j++){
	//		M[max(i, j)] += tmp_a[i] * tmp_b[j];
	//		m[min(i, j)] += tmp_a[i] * tmp_b[j];
	//	}
	//}

	for (int i = n; i >= 1; i--) S_c[i] = S_c[i + 1] + M[i] + m[i];
	for (int i = 1; i <= n; i++) S[i] = S_c[i] - S_c[i + 1];

	double p = -S[1], q = M[1];
	A[1] = a[1] = (-p + powl(p*p - 4 * q, 0.5)) / 2;
	B[1] = b[1] = S[1] - a[1];

	for (int i = 2; i <= n; i++){
		double p = -(B[i - 1] - A[i - 1] + S[i]);
		double q = M[i] - S[i] * A[i - 1];
		double x1 = (-p + powl(p*p - 4 * q, 0.5)) / 2;
		double x2 = (-p - powl(p*p - 4 * q, 0.5)) / 2;
		double y1 = S[i] - x1, y2 = S[i] - x2;

		if (!(-EPS <= x1 && x1 <= 1 + EPS && -EPS <= A[i - 1] + x1 && A[i - 1] + x1 <= 1 + EPS
			&& -EPS <= y1 && y1 <= 1 + EPS && -EPS <= B[i - 1] + y1 && B[i - 1] + y1 <= 1 + EPS))
			swap(x1, x2), swap(y1, y2);

		a[i] = x1; A[i] = A[i - 1] + a[i];
		b[i] = y1; B[i] = B[i - 1] + b[i];
	}

	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << a[i] << ' ';
	}
	printf("\n");
	for (int i = 1; i <= n; i++){
		cout << setprecision(10) << b[i] << ' ';
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cassert>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <iomanip>
using namespace std;
//#define int long long
const int INF = 1234567890;
const long double e = 1e-8;
typedef long double ld;
pair < ld, ld > mas[100010];
ld ss[100010];
pair <ld, ld> ans[100010];
signed main() {

	ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].first;
	}
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].second;
	}
	for (int i = 1; i <= n; ++i) {
		ss[i] = mas[i].first + mas[i].second;
	}
	ld sa = 0;
	ld sb = 0;
	for (int i = 1; i <= n; ++i) {
		ld aa = 1;
		ld bb = sa - sb + 1 * ss[i];
		ld cc = -sb * ss[i] + mas[i].first;
		ld dd = bb * bb - 4 * aa * cc;
		if (dd < 0) {
			dd = 0;
		}
		ld sqdd = sqrt(dd);
		ld b1 = (bb + sqdd) / 2 / aa;
		ld b2 = (bb - sqdd) / 2 / aa;
		if (b1 + e >= 0 && b1 - e <= 1) {
			ans[i].second = b1;
			ans[i].first = ss[i] - b1;
		}
		else {
			ans[i].second = b2;
			ans[i].first = ss[i] - b2;
		}
		sa += ans[i].first;
		sb += ans[i].second;
	}
	cout << fixed << setprecision(7);
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].first << ' ';
	}
	cout << endl;
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].second << ' ';
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cassert>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <iomanip>
using namespace std;
//#define int long long
const int INF = 1234567890;
const long double e = 1e-8;
typedef long double ld;
pair < ld, ld > mas[1000000];
ld ss[1000000];
pair <ld, ld> ans[1000000];
signed main() {

	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].first;
	}
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].second;
	}
	for (int i = 1; i <= n; ++i) {
		ss[i] = mas[i].first + mas[i].second;
	}
	ld sa = 0;
	ld sb = 0;
	for (int i = 1; i <= n; ++i) {
		ld aa = 1;
		ld bb = sa - sb + 1 * ss[i];
		ld cc = -sb * ss[i] + mas[i].first;
		ld dd = bb * bb - 4 * aa * cc;
		ld sqdd = sqrt(dd);
		ld b1 = (bb + sqdd) / 2 / aa;
		ld b2 = (bb - sqdd) / 2 / aa;
		if (b1 + e >= 0 && b1 - e <= 1) {
			ans[i].second = b1;
			ans[i].first = ss[i] - b1;
		}
		else {
			ans[i].second = b2;
			ans[i].first = ss[i] - b2;
		}
		sa += ans[i].first;
		sb += ans[i].second;
	}
	cout << fixed << setprecision(10);
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].first << ' ';
	}
	cout << endl;
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].second << ' ';
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cassert>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <iomanip>
using namespace std;
//#define int long long
const int INF = 1234567890;
const long double e = 1e-8;
typedef long double ld;
pair < ld, ld > mas[100010];
ld ss[100010];
pair <ld, ld> ans[100010];
signed main() {

	ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].first;
	}
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].second;
	}
	for (int i = 1; i <= n; ++i) {
		ss[i] = mas[i].first + mas[i].second;
	}
	ld sa = 0;
	ld sb = 0;
	for (int i = 1; i <= n; ++i) {
		ld aa = 1;
		ld bb = sa - sb + 1 * ss[i];
		ld cc = -sb * ss[i] + mas[i].first;
		ld dd = bb * bb - 4 * aa * cc;
		if (dd < 0) {
			dd = 0;
		}
		ld sqdd = sqrt(dd);
		ld b1 = (bb + sqdd) / 2 / aa;
		ld b2 = (bb - sqdd) / 2 / aa;
			ans[i].second = b1;
			ans[i].first = ss[i] - b1;
		sa += ans[i].first;
		sb += ans[i].second;
	}
	cout << fixed << setprecision(7);
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].first << ' ';
	}
	cout << endl;
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].second << ' ';
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cassert>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <iomanip>
using namespace std;
//#define int long long
const int INF = 1234567890;
const long double e = 1e-8;
typedef long double ld;
pair < ld, ld > mas[100010];
ld ss[100010];
pair <ld, ld> ans[100010];
signed main() {

	ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].first;
	}
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i].second;
	}
	for (int i = 1; i <= n; ++i) {
		ss[i] = mas[i].first + mas[i].second;
	}
	ld sa = 0;
	ld sb = 0;
	for (int i = 1; i <= n; ++i) {
		ld aa = 1;
		ld bb = sa - sb + 1 * ss[i];
		ld cc = -sb * ss[i] + mas[i].first;
		ld dd = bb * bb - 4 * aa * cc;
		ld sqdd = sqrt(dd);
		ld b1 = (bb + sqdd) / 2 / aa;
		ld b2 = (bb - sqdd) / 2 / aa;
		if (b1 + e >= 0 && b1 - e <= 1) {
			ans[i].second = b1;
			ans[i].first = ss[i] - b1;
		}
		else {
			ans[i].second = b2;
			ans[i].first = ss[i] - b2;
		}
		sa += ans[i].first;
		sb += ans[i].second;
	}
	cout << fixed << setprecision(7);
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].first << ' ';
	}
	cout << endl;
	for (int i = 1; i <= n; ++i) {
		cout << ans[i].second << ' ';
	}
}


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(b*b-4*a*c))/2/a;
	double v=(-b-sqrt(b*b-4*a*c))/2/a;
	return pdd(u, v);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first) swap(res.first, res.second);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(max(0., b*b-4*a*c)))/2/a;
	double v=(-b-sqrt(max(0., b*b-4*a*c)))/2/a;
	return pdd(u, v);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			//if(rp > res.first) swap(res.first, res.second);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++)
	{
		p[i]=max(p[i], 0.);
		p[i]=min(p[i], 1.);
		q[i]=max(q[i], 0.);
		q[i]=min(q[i], 1.);
	}
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(max(0., b*b-4*a*c)))/2/a;
	double v=(-b-sqrt(max(0., b*b-4*a*c)))/2/a;
	return pdd(v, u);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first) swap(res.first, res.second);
			if(rp > res.first) for(;;);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(b*b-4*a*c))/2/a;
	double v=(-b-sqrt(b*b-4*a*c))/2/a;
	return pdd(v, u);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first) swap(res.first, res.second);
			//if(rp > res.first) for(;;);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(max(0., b*b-4*a*c)))/2/a;
	double v=(-b-sqrt(max(0., b*b-4*a*c)))/2/a;
	return pdd(u, v);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first) swap(res.first, res.second);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(b*b-4*a*c))/2/a;
	double v=(-b-sqrt(b*b-4*a*c))/2/a;
	return pdd(u, v);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first) swap(res.first, res.second);
			if(rp > res.first) for(;;);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n;
double a[200000], b[200000];

double p[200000], q[200000];

pdd getval(double A, double B)
{
	double a=1, b=-(1+A-B), c=A;
	double u=(-b+sqrt(max(0., b*b-4*a*c)))/2/a;
	double v=(-b-sqrt(max(0., b*b-4*a*c)))/2/a;
	return pdd(u, v);
}

int main()
{
	int i, j, k, l;
	cin>>n;
	for(i=0;i<n;i++) scanf("%lf", &a[i]);
	for(i=0;i<n;i++) scanf("%lf", &b[i]);
	for(i=1;i<n;i++) a[i]+=a[i-1];
	for(i=n-2;i>=0;i--) b[i]+=b[i+1];
	double rp=0, rq=0;
	for(i=0;i<n-1;i++)
	{
		pdd res=getval(a[i], b[i+1]);
		if(!i)
		{
			p[0]=res.first, q[0]=res.second;
		}
		else
		{
			if(rp > res.first+ERR) swap(res.first, res.second);
			p[i]=res.first-rp, q[i]=res.second-rq;
		}
		rp+=p[i], rq+=q[i];
	}
	p[n-1]=1-rp, q[n-1]=1-rq;
	/*for(i=0;i<n;i++)
	{
		p[i]=max(p[i], 0.);
		p[i]=min(p[i], 1.);
		q[i]=max(q[i], 0.);
		q[i]=min(q[i], 1.);
	}*/
	for(i=0;i<n;i++) printf("%.20lf ", p[i]);
	printf("\n");
	for(i=0;i<n;i++) printf("%.20lf ", q[i]);
	return 0;
}
//*/


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		sa += pa[i];
		sb += pb[i];
	}

	if(abs(1-sa) > eps || abs(1-sb) > eps){
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		assert(b*b-4*c >= 0);

		Log("pmin, pmax", x,y);
		Log("a,b,c",a,b,c);

		ld a1 = (-b + sqrt(b*b-4*c))/2;
		ld b1 = x+y-a1;
		ld a2 = (-b - sqrt(b*b-4*c))/2;
		ld b2 = x+y-a2;

		Log("a1,b1",a1,b1);
		Log("a2,b2",a2,b2);

		// minimize the max of sa and sb
		if(max(sa+a1, sb+b1) > max(sa+a2, sb+b2)){
			pa[i] = a2;
			pb[i] = b2;
		} else {
			pa[i] = a1;
			pb[i] = b1;
		}

		Log("a,b", pa[i], pb[i]);

		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < -eps || pb[i] < -eps || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		assert(b*b-4*c >= 0);

		Log("pmin, pmax", x,y);
		Log("a,b,c",a,b,c);

		ld a1 = (-b + sqrt(b*b-4*c))/2;
		ld b1 = x+y-a1;
		ld a2 = (-b - sqrt(b*b-4*c))/2;
		ld b2 = x+y-a2;

		Log("a1,b1",a1,b1);
		Log("a2,b2",a2,b2);

		// minimize the max of sa and sb
		if(max(sa+a1, sb+b1) > max(sa+a2, sb+b2)){
			pa[i] = a2;
			pb[i] = b2;
		} else {
			pa[i] = a1;
			pb[i] = b1;
		}

		Log("a,b", pa[i], pb[i]);

		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	assert(sa < 1+eps);
	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		Log("pmin, pmax", x,y);
		Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*a*c))/(2*a);
		pb[i] = x+y-pa[i];
		Log("pa,pb",pa[i], pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		sa += pa[i];
		sb += pb[i];
	}

	if(abs(1-sa) > eps || abs(1-sb) > eps){
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	bool skip = false;
	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		if(pa[i] < 0 || pb[i] < 0 || pa[i] == NAN || pb[i] == NAN){
			skip = true;
			break;
		}

		sa += pa[i];
		sb += pb[i];
	}

	if(skip || abs(1-sa) > 1e-7 || abs(1-sb) > 1e-7){
		sa=sb=0;
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		assert(b*b-4*c >= 0);

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < 0 || pb[i] < 0 || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}
		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		sa += pa[i];
		sb += pb[i];
	}

	if(abs(1-sa) > eps || abs(1-sb) > eps){
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b + sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(10) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(10) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	bool skip = false;
	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		if(pa[i] == NAN || pb[i] == NAN){
			skip = true;
			break;
		}

		sa += pa[i];
		sb += pb[i];
	}

	if(skip || abs(1-sa) > 1e-7 || abs(1-sb) > 1e-7){
		sa=sb=0;
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b - sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < -eps || pb[i] < -eps || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b + sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	bool skip = false;
	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		if(pa[i] == NAN || pb[i] == NAN){
			skip = true;
			break;
		}

		sa += pa[i];
		sb += pb[i];
	}

	if(skip || abs(1-sa) > 1e-7 || abs(1-sb) > 1e-7){
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < 0 || pb[i] < 0 || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}
		pa[i] = max(pa[i],ld(0));
		pb[i] = max(pb[i],ld(0));

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		assert(b*b-4*c >= 0);

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < 0 || pb[i] < 0 || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}
		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	assert(sa < 1+eps);
	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		assert(b*b-4*c >= 0);

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		ld a1 = (-b + sqrt(b*b-4*c))/2;
		ld b1 = x+y-pa[i];
		ld a2 = (-b - sqrt(b*b-4*c))/2;
		ld b2 = x+y-pa[i];

		// minimize the max of sa and sb
		if(max(sa+a1, sb+b1) > max(sa+a2, sb+b2)){
			pa[i] = a2;
			pb[i] = b2;
		} else {
			pa[i] = a1;
			pb[i] = b1;
		}

		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	assert(sa < 1+eps);
	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		Log("pmin, pmax", x,y);
		Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		Log("pa,pb",pa[i], pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << fixed << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << fixed << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		Log("pmin, pmax", x,y);
		Log("a,b,c",a,b,c);

		pa[i] = (-b - sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		Log("pa,pb",pa[i], pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << fixed << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << fixed << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(max(ld(0),b*b-4*c)))/2;
		pb[i] = x+y-pa[i];

		sa += pa[i];
		sb += pb[i];
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-8;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];

		sa += pa[i];
		sb += pb[i];
	}

	if(abs(1-sa) > 1e-7 || abs(1-sb) > 1e-7){
		for(ll i=0; i<n; ++i){
			ld x = pmin[i], y = pmax[i];
			ld a = 1;
			ld b = -sb + sa - x - y;
			ld c = -(x+y)*sa + y;

			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];

			sa += pa[i];
			sb += pb[i];
		}
	}

//	assert(sa < 1+eps);
//	assert(sb < 1+eps);

	for(auto p : pa) cout << setprecision(8) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(8) << p << ' ';
	cout << '\n';

	return 0;
}


#define HEADER_H
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i,n)	for(auto i=decltype(n)(0); i<(n); ++i)
#define all(v)		begin(v), end(v)
using namespace std;		using ull= unsigned long long;
using ll = long long;		using ld = long double;
using vi = vector<ll>;		using vvi= vector<vi>;
using vb = vector<bool>;	using ii = pair<ll,ll>;
constexpr bool LOG = false;
void Log() { if(LOG) cerr << "\n"; }
template<class T, class... S> void Log(T t, S... s){
	if(LOG) cerr << t << "\t", Log(s...);
} /* ============== END OF HEADER ============== */

constexpr ld eps = 1e-9;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr);
	cout << fixed;
	ll n; cin >> n;
	vector<ld> pa(n), pb(n), pmin(n), pmax(n);
	ld sa=0, sb=0;
	for(auto &x : pmax) cin >> x;
	for(auto &x : pmin) cin >> x;

	for(ll i=0; i<n; ++i){
		ld x = pmin[i], y = pmax[i];
		ld a = 1;
		ld b = -sb + sa - x - y;
		ld c = -(x+y)*sa + y;

		//Log("pmin, pmax", x,y);
		//Log("a,b,c",a,b,c);

		pa[i] = (-b + sqrt(b*b-4*c))/2;
		pb[i] = x+y-pa[i];
		//Log("pa,pb",pa[i], pb[i]);

		if(pa[i] < 0 || pb[i] < 0 || sa+pa[i] > 1+eps || sb+pb[i] > 1+eps){
			pa[i] = (-b - sqrt(b*b-4*c))/2;
			pb[i] = x+y-pa[i];
		}
		pa[i] = max(ld(0), pa[i]);
		pb[i] = max(ld(0), pb[i]);

		sa += pa[i];
		sb += pb[i];
	}

	for(auto p : pa) cout << setprecision(15) << p << ' ';
	cout << '\n';
	for(auto p : pb) cout << setprecision(15) << p << ' ';
	cout << '\n';

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll unsigned long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back
#define INF 1000000000
#define EPS 0.000000000000000001l
int n;
double a[100005],b[100005],p[100005],q[100005];
int main() {
	scanf("%d",&n);
	for (int i=0;i<n;i++) {
		scanf("%Lf",&a[i]);
	}
	for (int i=0;i<n;i++) {
		scanf("%Lf",&b[i]);
	}
	double sp=0.0,sq=0.0;
	for (int i=0;i<n;i++) {
		double x=a[i]+b[i];
		double c2=sp-sq-x,c3=a[i]-x*sp;
		p[i]=(-c2+sqrt(fabs(c2*c2-4.0*c3)))/2.0;
		q[i]=x-p[i];
		sp+=p[i];
		sq+=q[i];
	}
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(p[i]));
	}
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(q[i]));
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll unsigned long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back
#define INF 1000000000
#define double long double
#define EPS 0.000000000000000001l
int n;
double a[100005],b[100005],p[100005],q[100005];
int main() {
	scanf("%d",&n);
	for (int i=0;i<n;i++) {
		scanf("%Lf",&a[i]);
	}
	for (int i=0;i<n;i++) {
		scanf("%Lf",&b[i]);
	}
	double sp=0.0l,sq=0.0l;
	for (int i=0;i<n;i++) {
		double x=a[i]+b[i];
		double c2=sp-sq-x,c3=a[i]-x*sp;
		double k=sqrt(c2*c2-4.0l*c3+EPS);
		p[i]=(-c2+sqrt(c2*c2-4.0l*c3+EPS))/2.0l;
		q[i]=x-p[i]+EPS;
		sp+=p[i];
		sq+=q[i];
	}
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(p[i]));
	}
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(q[i]));
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll unsigned long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back
#define INF 1000000000
#define double long double
#define EPS 0.000000000000000001l
int n;
double a[100005],b[100005],p[100005],q[100005];
int main() {
	scanf("%d",&n);
	for (int i=0;i<n;i++) {
		scanf("%Lf",&a[i]);
	}
	for (int i=0;i<n;i++) {
		scanf("%Lf",&b[i]);
	}
	double sp=0.0l,sq=0.0l;
	for (int i=0;i<n;i++) {
		double x=a[i]+b[i];
		double c2=sp-sq-x,c3=a[i]-x*sp;
		p[i]=(-c2+sqrt(fabs(c2*c2-4.0l*c3)))/2.0l;
		q[i]=x-p[i];
		sp+=p[i];
		sq+=q[i];
	}
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(p[i]));
	}
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", fabs(q[i]));
	}
	printf("\n");
}