#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")
//#pragma GCC target("avx2")

#define deb(x) cout << #x << " = " << x << "\n"
#define all(x) (x).begin(), (x).end()
#define len(x) (int) x.size()
#define lsb(x) (x) & -(x)
#define l(x) (x << 1) + 1
#define r(x) (x << 1) + 2

#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ld, ld> pld;
typedef pair <ll, ll> pll;

template <class T1, class T2 = less <T1>> using pb_heap = __gnu_pbds::priority_queue <T1, T2, binary_heap_tag>;
template <class T1, class T2 = null_type, class T3 = less <T1>> using pb_map = tree <T1, T2, T3, rb_tree_tag, tree_order_statistics_node_update>;
template <class T1, class T2 = null_type, class T3 = hash <T1>> using pb_umap = gp_hash_table <T1, T2, T3>;
template <class T1, class T2, class T3 = hash <T1>> using umap = unordered_map <T1, T2, T3>;
template <class T> using uset = unordered_set <T>;
template <class T> using vec = vector <T>;

const ll infll = numeric_limits <ll>::max() >> 1;
const int inf = numeric_limits <int>::max() >> 1;
const int N = 1e5 + 1;
double sumx;
double sumy;
double mnm[N];
double mxm[N];
double ansx[N];
double ansy[N];

int n;

void input() {
    cin >> n;
    for(int i = 1; i <= n; ++i) {
        cin >> mxm[i];
    }
    for(int i = 1; i <= n; ++i) {
        cin >> mnm[i];
    }
}

double sq(double x) {
    return x * x;
}

double solve_x(double n, double m, double a, double b) {
    return 1.0 / 2 * (sqrt(max(0.0, sq(a) * sq(b - 1) - 2 * a * (b - 1) * (b + m + n) + sq(b) + 2 * b * (m + n) + sq(m) + 2 * m * n + sq(n) - 4 * n)) - a * (b + 1) + b + m + n);
}

void solve() {
    for(int i = n; i >= 1; --i) {
        double num = mnm[i] + sumx * sumy;
        double x = solve_x(num, mxm[i], sumx, sumy);
        double y = num / (x + sumx) - sumy;
        sumx += x;
        sumy += y;
        ansx[i] = x;
        ansy[i] = y;
    }
    for(int i = 1; i <= n; ++i) {
        cout << fixed << setprecision(9) << ansx[i] << " ";
    }
    cout << "\n";
    for(int i = 1; i <= n; ++i) {
        cout << fixed << setprecision(9) << ansy[i] << " ";
    }
    cout << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    input();
    solve();
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    double xi[n], yi[n];
    for (int i = 0; i < n; i++) cin >> xi[i];
    for (int i = 0; i < n; i++) cin >> yi[i];
    double a[n + 1], b[n + 1], xt = 0, yt = 0;
    a[0] = b[0] = 0;
    for (int i = 0; i < n; i++) {
        double x = xi[i], y = yi[i];
        xt += x; yt += y;
        a[i + 1] = 0.5 * ((xt + yt) - sqrt(max((xt + yt) * (xt + yt) - 4.0 * xt, 0.0)));
        b[i + 1] = 0.5 * ((xt + yt) + sqrt(max((xt + yt) * (xt + yt) - 4.0 * xt, 0.0)));
    }
    for (int i = 0; i < n; i++) cout << fixed << setprecision(7) << a[i + 1] - a[i] << " "; cout << endl;
    for (int i = 0; i < n; i++) cout << fixed << setprecision(7) << b[i + 1] - b[i] << " "; cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int N;
double v[maxn] , w[maxn];
int main(){
    scanf("%d" , &N);
    for(int i = 1; i <= N; ++i)scanf("%lf" , &v[i]);
    for(int i = 1; i <= N; ++i)scanf("%lf" , &w[i]);
    for(int i = 1; i <= N; ++i){
        printf("%lf " , (v[i] + w[i]) / 2);
    }
    printf("\n");
    for(int i = 1; i <= N; ++i){
        printf("%lf " , (v[i] + w[i]) / 2);
    }
    printf("\n");
}


#include<bits/stdc++.h>
using namespace std;
double pmax[200001],pmin[200001],sb[200001],sa[200001];
int n;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lf",pmax+i),pmax[i]+=pmax[i-1];
	for(int i=1;i<=n;i++)scanf("%lf",pmin+i);
	for(int i=n-1;i;i--)pmin[i]+=pmin[i+1];
	for(int i=1;i<=n;i++)
	{
		double a=1,b=pmin[i+1]-pmax[i]-1,c=pmax[i],dt=sqrt(abs(b*b-4*a*c));
		sa[i]=(dt-b)/(2*a);
		sb[i]=(-dt-b)/(2*a);
	}
	for(int i=1;i<=n;i++)printf("%.8g ",sa[i]-sa[i-1]);
	puts("");
	for(int i=1;i<=n;i++)printf("%.8g ",sb[i]-sb[i-1]);
	puts("");
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ss second
#define ff first
#define int long long
#define double long double
#define pb push_back

const int N = 7e5 + 51, MOD = 1e9 + 7, mod = 998244353,INF = 2e18;

mt19937 Flash_new_51(51515);

using vi = vector <int>;
using vp = vector <pair <int, int>>;

double a[N], b[N], ans[2][N];

signed main() {
    #ifdef Flash
     freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int j = 0; j < n; j++) {
        cin >> b[j];
    }
    double sum1 = 0, sum2 = 0;
    for (int i = 0; i < n; i++) {
        double x = b[i] + a[i];
        //i' = x - i

        // sum2 * i + sum1 * i' + i * i' = a[i]
        //sum2 * i + sum1 * x - sum1 * i + i * x - i^2  -a[i] = 0

        //sum2 * i - sum1 * i + i * x - i^2 = 0
        double C = sum1 * x - a[i];
        double B = sum2 - sum1 + x, A = -1.0;
        double D = abs(sqrt(abs(B * B - 4.0 * A * C)));

        double X1 = (-B + D) / (2.0 * A), X2 = (-B - D) / (2.0 * A);
        if (X2 > X1) {
            swap(X1, X2);
        }
        ans[0][i] = X1;
        ans[1][i] = x - X1;
        sum1 += abs(ans[0][i]);
        sum2 += abs(ans[1][i]);
    }
    for (int i = 0; i <= 1; i++) {
        for (int j = 0; j < n; j++) {
            cout << setprecision(30) << fixed << abs(ans[i][j]) << ' ';
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ss second
#define ff first
#define int long long
#define double long double
#define pb push_back

const int N = 7e5 + 51, MOD = 1e9 + 7, mod = 998244353,INF = 2e18;

mt19937 Flash_new_51(51515);

using vi = vector <int>;
using vp = vector <pair <int, int>>;

double a[N], b[N], ans[2][N];

signed main() {
    #ifdef Flash
     freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int j = 0; j < n; j++) {
        cin >> b[j];
    }
    double sum1 = 0, sum2 = 0;
    for (int i = 0; i < n; i++) {
        double x = b[i] + a[i];
        //i' = x - i

        // sum2 * i + sum1 * i' + i * i' = a[i]
        //sum2 * i + sum1 * x - sum1 * i + i * x - i^2  -a[i] = 0

        //sum2 * i - sum1 * i + i * x - i^2 = 0
        double C = sum1 * x - a[i];
        double B = sum2 - sum1 + x, A = -1.0;
        double D = sqrt(B * B - 4 * A * C);

        double X1 = (-B + D) / (2.0 * A), X2 = (-B - D) / (2.0 * A);
        if (X2 > X1) {
            swap(X1, X2);
        }
        ans[0][i] = X1;
        ans[1][i] = x - X1;
        sum1 += abs(ans[0][i]);
        sum2 += abs(ans[1][i]);
    }
    for (int i = 0; i <= 1; i++) {
        for (int j = 0; j < n; j++) {
            cout << setprecision(30) << fixed << abs(ans[i][j]) << ' ';
        }
        cout << "\n";
    }
}


/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 101000;
int n;
ld mx[MAXN],mn[MAXN],pa[MAXN],pb[MAXN],smx[MAXN],smn[MAXN];

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

  cin >> n;
  for(int i=1;i<=n;i++){
    cin >> mx[i];
    smx[i]=smx[i-1]+mx[i];
  }
  for(int i=1;i<=n;i++){
    cin >> mn[i];
    smn[i]=smn[i-1]+mn[i];
  }
  for(int i=1;i<=n;i++){
    ld b = smn[i]+smx[i];
    pa[i] = (b-sqrt(max(b*b-4*smx[i],(ld)0.00)))/2;
    pb[i] = (b+sqrt(max(b*b-4*smx[i],(ld)0.00)))/2;
  }
  for(int i=1;i<=n;i++){
    cout << fixed << setprecision(9) << pa[i]-pa[i-1] << " ";
  }
  cout << endl;
  for(int i=1;i<=n;i++){
    cout << fixed << setprecision(9) << pb[i]-pb[i-1] << " ";
  }
  cout << endl;

return 0;
}
///....


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <atcoder/all>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
//using namespace atcoder;

typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 303020;
const int K = 300;
const int mod = 998244353;
long double a[N], b[N], ans1[N], ans2[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    long double p1 = 0;
    long double p2 = 0;
    long double s1 = 1;
    long double s2 = 1;
    for (int i = 1; i <= n; i++){
        long double d1 = 4 * (p1 * b[i] - s1 * a[i]) * (p2 + s2) + (a[i] + b[i] + p2 * s1 - p1 * s2) * (a[i] + b[i] + p2 * s1 - p1 * s2);
        if (d1 - 1e-14 < 0) d1 = 0; else d1 = sqrt(d1);
        long double x = (a[i] + b[i] + p2 * s1 - p1 * s2 + d1) / 2;
        long double y = (a[i] + b[i] - p2 * s1 + p1 * s2 - d1) / 2;
        ans1[i] = x;
        ans2[i] = y;
        p1 += x;
        p2 += y;
        s1 = 1 - p1;
        s2 = 1 - p2;
    }
    cout << fixed << setprecision(15);
    for (int i = 1; i <= n; i++) cout << ans1[i] << " ";
    cout << endl;
    for (int i = 1; i <= n; i++) cout << ans2[i] << " ";
}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <atcoder/all>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
//using namespace atcoder;

typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 303020;
const int K = 300;
const int mod = 998244353;
double a[N], b[N], ans1[N], ans2[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    double p1 = 0;
    double p2 = 0;
    double s1 = 1;
    double s2 = 1;
    for (int i = 1; i <= n; i++){
        double d1 = sqrt(4 * (p1 * b[i] - s1 * a[i]) * (p2 + s2) + (a[i] + b[i] + p2 * s1 - p1 * s2) * (a[i] + b[i] + p2 * s1 - p1 * s2));
        double x = (a[i] + b[i] + p2 * s1 - p1 * s2 + d1) / (2 * (p2 + s2));
        double y = (a[i] + b[i] - p2 * s1 + p1 * s2 - d1) / (2 * (p1 + s1));
        ans1[i] = x;
        ans2[i] = y;
        p1 += x;
        p2 += y;
        s1 = 1 - p1;
        s2 = 1 - p2;
    }
    cout << fixed << setprecision(15);
    for (int i = 1; i <= n; i++) cout << ans1[i] << " ";
    cout << endl;
    for (int i = 1; i <= n; i++) cout << ans2[i] << " ";
}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <atcoder/all>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
//using namespace atcoder;

typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 303020;
const int K = 300;
const int mod = 998244353;
long double a[N], b[N], ans1[N], ans2[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    long double p1 = 0;
    long double p2 = 0;
    long double s1 = 1;
    long double s2 = 1;
    for (int i = 1; i <= n; i++){
        long double d1 = 4 * (p1 * b[i] - s1 * a[i]) * (p2 + s2) + (a[i] + b[i] + p2 * s1 - p1 * s2) * (a[i] + b[i] + p2 * s1 - p1 * s2);
        if (d1 + 1e-12 < 0) d1 = 0; else d1 = sqrt(d1);
        long double x = (a[i] + b[i] + p2 * s1 - p1 * s2 + d1) / (2 * (p2 + s2));
        long double y = (a[i] + b[i] - p2 * s1 + p1 * s2 - d1) / (2 * (p1 + s1));
        ans1[i] = x;
        ans2[i] = y;
        p1 += x;
        p2 += y;
        s1 = 1 - p1;
        s2 = 1 - p2;
    }
    cout << fixed << setprecision(15);
    for (int i = 1; i <= n; i++) cout << ans1[i] << " ";
    cout << endl;
    for (int i = 1; i <= n; i++) cout << ans2[i] << " ";
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    return (-b + sqrt(d))/ 2 / a *1.0;
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    return max((-b - sqrt(d))/ 2 / a *1.0, (-b + sqrt(d))/ 2 / a *1.0);
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    while (sum_p - 1.0 > 0.000001) {
        int k = 1;
    }
    while (sum_r - 1.0 > 0.000001) {
        int k = 1;
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    if (d < 0)
        d = 0.0;
    return ((-b + sqrt(d))/ 2 / a *1.0);
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    while (1.0 - sum_p > 0.000001) {
        int k = 1;
    }
    while (1.0 - sum_r  > 0.000001) {
        int k = 1;
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    return max((-b - sqrt(d))/ 2 / a *1.0, (-b + sqrt(d))/ 2 / a *1.0);
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    return max((-b - sqrt(d))/ 2 / a *1.0, (-b + sqrt(d))/ 2 / a *1.0);
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    while (1.0 - sum_p > 0.000001) {
        int k = 1;
    }
    while (1.0 - sum_r  > 0.000001) {
        int k = 1;
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <iostream>
#include <math.h>
#include <vector>

using namespace std;

double solve(double a, double b, double c) {
    double d = b * b - 4.0 * a * c;
    return ((-b + sqrt(d))/ 2 / a *1.0);
}

int main() {
    int n;
    cin >> n;
    cout << fixed;
    cout.precision(9);
    vector<double> x(n), y(n), r(n), p(n);
    for (int i = 0; i < n; ++i)
        cin >> x[i];
    for (int i = 0; i < n; ++i)
        cin >> y[i];
    double sum_r = 0, sum_p = 0;
    for (int i = 0; i < n; ++i) {
        r[i] = solve(1.0, (sum_r - sum_p - x[i] - y[i]), (x[i] - (x[i] + y[i]) * sum_r));
        p[i] = x[i] + y[i] - r[i];
        sum_p += p[i];
        sum_r += r[i];
    }
    while (1.0 - sum_p > 0.000001) {
        int k = 1;
    }
    while (1.0 - sum_r  > 0.000001) {
        int k = 1;
    }
    for (int i = 0; i < n; ++i) {
        if (r[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << r[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
        if (p[i] <= 0)
            cout << 0.0 << " ";
        else
            cout << p[i] << " ";
    }
    cout << endl;
}


#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    //freopen("input.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);

    int n;
    cin >> n;

    vector<double> mins(n), maxs(n), a(n), b(n);
    for (int i = 0; i < n; ++i)
        cin >> maxs[i];
    for (int i = 0; i < n; ++i)
        cin >> mins[i];

    double sumin = 1, sumax = 0, sumf = 0, sums = 0;

    for (int i = 0; i < n; ++i) {
        sumin -= mins[i];
        sumax += maxs[i];

      //  cout << sumin << ' ' << sumax << '\n';

        double t = abs((1 + sumax - sumin) * (1 + sumax - sumin) - 4 * sumax);
        double f = abs(((sumin - sumax - 1) + sqrt(t))) / 2;
        double s = f == 0? 1 : sumax / f;
        a[i] = f - sumf;
        b[i] = s - sums;
        sumf += f - sumf;
        sums += s - sums;
    }

    for (auto i : a)
        cout << setprecision(10) << fixed <<  i << ' ' ;
    cout << '\n';
    for (auto i : b)
        cout << setprecision(10) << fixed << i << ' ';

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    //freopen("input.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);

    int n;
    cin >> n;

    vector<double> mins(n), maxs(n), a(n), b(n);
    for (int i = 0; i < n; ++i)
        cin >> maxs[i];
    for (int i = 0; i < n; ++i)
        cin >> mins[i];

    double sumin = 1, sumax = 0, sumf = 0, sums = 0;

    for (int i = 0; i < n; ++i) {
        sumin -= mins[i];
        sumax += maxs[i];

      //  cout << sumin << ' ' << sumax << '\n';

        double t = (1 + sumax - sumin) * (1 + sumax - sumin) - 4 * sumax;
        double f = abs(((sumin - sumax - 1) + sqrt(t))) / 2;
        double s = f == 0? 1 : sumax / f;
        a[i] = f - sumf;
        b[i] = s - sums;
        sumf += f - sumf;
        sums += s - sums;
    }

    for (auto i : a)
        cout << setprecision(10) << fixed <<  i << ' ' ;
    cout << '\n';
    for (auto i : b)
        cout << setprecision(10) << fixed << i << ' ';

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    //freopen("input.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);

    int n;
    cin >> n;

    vector<double> mins(n), maxs(n), a(n), b(n);
    for (int i = 0; i < n; ++i)
        cin >> maxs[i];
    for (int i = 0; i < n; ++i)
        cin >> mins[i];

    double sumin = 1, sumax = 0, sumf = 0, sums = 0;

    for (int i = 0; i < n; ++i) {
        sumin -= mins[i];
        sumax += maxs[i];

        double t = (1 + sumax - sumin) * (1 + sumax - sumin) - 4 * sumax;
        double f = abs(((sumin - sumax - 1) + sqrt(t))) / 2;
        double s = sumax / f;
        a[i] = f - sumf;
        b[i] = s - sums;
        sumf += f - sumf;
        sums += s - sums;
    }

    for (auto i : a)
        cout << i << ' ' ;
    cout << '\n';
    for (auto i : b)
        cout << i << ' ';

    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef tuple<int, int, int> tiii;
typedef tuple<int, int, int, int> tiiii;
typedef set <int> si;
typedef map <int, int> mii;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <vector <int>> vvi;
typedef vector<pii> vpii;
#define F(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define f(i, a, b) for(int i = (int)a; i >= (int)b; i--)
#define F2(i, a, b) for(int i = (int)a; i <= (int)b; i+=2)
#define f2(i, a, b) for(int i = (int)a; i >= (int)b; i-=2)
#define wh(n) int iteration = n; while(iteration--)
#define For(t, it) for(auto it = (t).begin(); it != (t).end(); ++it)
#define IN insert
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define RS resize
#define uset unordered_set
#define umap unordered_map
#define RBT tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ld const PI = acos(-1), E = 1e-7;

bool good_prob(ld x){
	return (x > -E && x < 1+E);
}

/*
p_max(a) = p1(a)*sum(i = 1 -> a){p2(i)} + p2(a)*sum(i = 1 -> a-1){p1(i)}
p_min(a) = p1(a)*sum(i = a -> n){p2(i)} + p2(a)*sum(i = a+1 -> n){p1(i)}
p_max(a) + p_min(a) = p1(a)*(1 + p2(a)) + p2(a)*(1 - p1(a)) = p1(a) + p2(a)

for every number q:
let x = p1(q), y = p2(q)
a = sum(i = 0 -> q-1){p2(q)}, b = sum(i = 0 -> q-1){p1(q)}
c = p_max(q), d = p_max(q)+p_min(q)

need to solve a system

ax + xy + by = c
x + y = d
*/

void solve(ld a, ld b, ld c, ld d, ld &x, ld &y){
	/*
	x = d-y
	a(d-y) + (d-y)y + by = c
	ad - ay + dy - y^2 + by = c
	y^2 + (a-b-d)y + (c-ad) = 0

	y^2 + b'y + c'; = 0
	*/
	c = c-a*d;
	b = a-b-d;
	ld D = max((ld)0, b*b - c*4);
	ld y1 = (-b + sqrt(D))/2, y2 = (-b + sqrt(D))/2;
	ld x1 = (d - y1), x2 = (d - y2);
	if(good_prob(x1) && good_prob(y1))
		x = x1, y = y1;
	else
		x = x2, y = y2;
}

int const N = 1e5 + 4;
ld p1[N], p2[N], p_max[N], p_min[N], s1 = 0, s2 = 0;

//#define LOCAL
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
        #ifdef LOCAL
        freopen("in", "r", stdin);
        freopen("out", "w", stdout);
        #endif
        int n;
        cin >> n;
        F(i, 1, n)
        	cin >> p_max[i];
        F(i, 1, n){
        	cin >> p_min[i];
        	solve(s2, s1, p_max[i], p_max[i]+p_min[i], p1[i], p2[i]);
        	s1 += p1[i];
        	s2 += p2[i];
        	cout << p1[i] << ' ';
        }
        cout << '\n';
        F(i, 1, n)
        	cout << p2[i] << ' ';
	return 0;
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>

using namespace std;

int main(){
    int n = 0;
    cin >> n;
    double mx[n];
    double mn[n];
    for (int i = 0;  i < n; ++i){
        cin >> mx[i];
    }
    for (int i = 0;  i < n; ++i){
        cin >> mn[i];
    }
    long double a[n];
    long double b[n];
    long double sum_a = 0, sum_b = 0;
    long double A1, A2, D, k1, k2;
    for (int i = n-1; i > -1; --i){
        A1 = mx[i];
        A2 = mn[i];
        A1 += A2;
        k1 = sum_a - sum_b - A1;
        k2 = A2 - sum_a * A1;
        D = k1 * k1 - 4*k2;
        D = sqrt(D);
        a[i] = (-k1 + D) / 2;
        b[i] = A1 - a[i];
        sum_a += a[i];
        sum_b += b[i];
    }
    cout << fixed << setprecision(12);
    for (int i = 0; i < n; ++i){
        cout << a[i] << ' ';
    }
    cout << '\n';
    for (int i = 0; i < n; ++i){
        cout << b[i] << ' ';
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>

using namespace std;

int main(){
    int n = 0;
    cin >> n;
    double mx[n];
    double mn[n];
    for (int i = 0;  i < n; ++i){
        cin >> mx[i];
    }
    for (int i = 0;  i < n; ++i){
        cin >> mn[i];
    }
    long double a[n];
    long double b[n];
    long double sum_a = 0, sum_b = 0;
    long double A1, A2, D, k1, k2;
    for (int i = n-1; i > -1; --i){
        A1 = mx[i];
        A2 = mn[i];
        A1 += A2;
        k1 = sum_a - sum_b - A1;
        k2 = A2 - sum_a * A1;
        D = k1 * k1 - 4*k2;
        D = sqrt(max(D, (long double) 0));
        a[i] = (-k1 + D) / 2;
        b[i] = A1 - a[i];
        sum_a += a[i];
        sum_b += b[i];
    }
    cout << fixed << setprecision(12);
    for (int i = 0; i < n; ++i){
        cout << a[i] << ' ';
    }
    cout << '\n';
    for (int i = 0; i < n; ++i){
        cout << b[i] << ' ';
    }
    return 0;
}


#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int uli;
typedef long double Lf;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define fastIO  std::ios::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007
#define N 100005
#define NN 2005
#define SZ(x) ((lli) (x).size())
#define loop(i,s,n) for(int i=(s);i<(n);i++)
#define loopr(i,n,s) for(int i=(n)-1;i>=(s);i--)
#define pb push_back
#define o2(a,b) cout<<(a)<<" "<<(b)<<endl
#define o3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define o4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define cl cout<<endl
#define r0 return 0
#define e0 exit(0)
#define x first
#define y second

inline lli modadd(lli n,lli m,lli p=mod){
    return ((n+m)%p+p)%p;
}

inline lli modsub(lli n,lli m,lli p=mod){
    return ((n-m+p)%p+p)%p;
}

inline lli modpro(lli n,lli m,lli p=mod){
    return (((n%p)*(m%p))%p+p)%p;
}

uli powe(lli x,lli y){
    uli res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

lli modpow(lli x,lli y,lli p=mod){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x, p);
        y = y >> 1;
        x = modpro(x , x, p);
    }
    return res;
}

inline lli modInverse(lli n, lli p=mod)
{
    if(n==1) return 1;
    return modpow(n, p-2, p);
}

inline lli moddiv(lli n,lli m,lli p=mod){
    return modpro(n,modInverse(m,p),p);
}

inline lli modadd3(lli x, lli y, lli z,lli p=mod){
    return modadd(modadd(x,y,p),z,p);
}

inline lli modadd4(lli x, lli y, lli z, lli w,lli p=mod){
    return modadd(modadd(x,y,p),modadd(z,w,p),p);
}

inline lli modnCr(lli fac[], int n, int r, lli p=mod)
{
    if (r==0) return 1;
    return modpro(fac[n],modInverse(modpro(fac[r],fac[n-r],p),p),p);
}

template <typename T>
inline T max3(T x, T y, T z){
    return max(max(x,y),z);
}

template <typename T>
inline T max4(T x, T y, T z, T w){
    return max(max3(x,y,w),z);
}

template <typename T>
inline T min3(T x, T y, T z){
    return min(min(x,y),z);
}

template <typename T>
inline T min4(T x, T y, T z, T w){
    return min(min3(x,y,w),z);
}

template <typename T>
void printArr(T *arr, int s, int n){
    for(int i=s;i<=n;i++){

        cout<<arr[i]<<" ";
    }cout<<endl;
}

//template<class X, class Y, class Z>
//struct triple {
//    X x;
//    Y y;
//    Z z;
//
//     friend bool operator<(triple a, triple b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else return a.z<=b.z;
//    }
//};
//
//
//template<class X, class Y, class Z, class W>
//class quad {
//    public:
//    X x;
//    Y y;
//    Z z;
//    W w;
//
//     friend bool operator<(quad a, quad b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else if(a.z!=b.z)return a.z<b.z;
//        else return a.w<b.w;
//    }
//};

//template <typename T>
//T gcd(T a, T b)
//{
//    if (a == 0)
//        return b;
//    if(b==0)
//        return a;
//    T t;
//    while((a>0)&&(b>0)){
//     t = a;
//     a=b%a;
//     b=t;
// }
//
// return max(a,b);
//}

//
//uli choose(uli n, uli k){
//uli res = 1;
//
//    // Since C(n, k) = C(n, n-k)
//    if ( k > n - k )
//        k = n - k;
//
//    // Calculate value of
//    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
//    for (uli i = 0; i < k; ++i)
//    {
//        res *= (n - i);
//        res /= (i + 1);
//    }
//
//    return res;
//}
//

//
//  vector<vector<pii>> adj;
//   //vector<int> dist;
//   vector<int> d;
////   vector<bool> visited;
////     vector<int> pa;
//   //queue<int> q;
//
//  class Graph{
//
//   public:
//      int V;
//
//  Graph(int V){
//      this->V = V;
//      adj.resize(V);
////        visited.resize(V);
//      //color.resize(V);
//      //dist.resize(V);
//        d.resize(V);
//     //// dist.resize(V);
////     pa.resize(V);
//
//  }
//
//  ~Graph(){
// 	  adj.clear();
// 	  //visited.clear();
// 	 // color.clear();
// 	 // dist.clear();
////    pa.clear();
// 	  //dist.clear();
//// 	  visited.clear();
//d.clear();
//
//
//  }
//
//
//  void addEdge(int a, int b)
//  {
//      adj[a].pb(b);
//      adj[b].pb(a);
//      //adj[b].pb({a,in});
//  }
//
// //  void dfs(int x){
// //    //  color[x]=1;
// //   visited[x]=1;
// //      for(auto u: adj[x]){
// //          if(visited[u]) continue;
// //
// //          dfs(u);
// //      }
// //
// //  }
// //
// //
// //
// //
// //
//  // void dfsTree(int x, int p){
//  //     for(auto u: adj[x]){
//  //         if(u==p) {continue;}
//  //         dfsTree(u,x);
//  //     }
//  // }
//
//
//void dijkstra(int s) {
//    d.assign(n, INF);
//    d[s] = 0;
//    set<pair<int, int>> q;
//    q.insert({0, s});
//    while (!q.empty()) {
//        int v = q.begin()->second;
//        q.erase(q.begin());
//        for (auto edge : adj[v]) {
//            int to = edge.first;
//            int len = edge.second;
//            if (d[v] + len < d[to]) {
//                q.erase({d[to], to});
//                d[to] = d[v] + len;
//                q.insert({d[to], to});
//            }
//        }
//    }
//}
//
//
////  void bfs(int x){
////      queue<int> q;
////      visited[x]=1;
////      q.push(x);
////      //dist[x]=0;
////      while(!q.empty()){
////          int s = q.front();
////          q.pop();
////
////          for(auto u : adj[s]){
////
////              if(visited[u]) continue;
////              pa[u]=s;
////              visited[u]=1;
////              //dist[u.x]=dist[s]+1;
////              q.push(u);
////          }
////      }
////  }
//
// //pair<int,int> farthest(int start){
// //    vector<int> dist(V,INT_MAX);
// //
// //    q.push(start);
// //    dist[start]=0;
// //    while(!q.empty()){
// //        int u = q.front();
// //        q.pop();
// //        for(int child: adj[u]){
// //            //if(keep[child])
// //            if(dist[child] > dist[u]+1) {
// //                dist[child] = dist[u]+1;
// //                q.push(child);
// //            }
// //        }
// //    }
// //    int big=-1,mi=-1;
// //    for(int i=1;i<n+1;i++){
// //        //if(keep[i])
// //        {
// //            if(dist[i]>big){
// //                big=dist[i];mi=i;
// //            }
// //        }
// //    }
// //    return make_pair(big,mi);
// //}
//
//
// //  int connectedcomponents(int n){
// //      int ans=0;
// //      loop(i,1,n+1){
// //          if(!visited[i]){
// //              ans++;
// //              dfs(i);
// //          }
// //
// //      }
// //      return ans;
// //  }
//
//  };

//template <typename T>
//T findpowerfactorial(T n,T p)
//{
//    T x = 0;
//    while (n)
//    {
//        n /= p;
//        x += n;
//    }
//    return x;
//}
//
//template <typename T>
//int getibit(T n, int i){
//    //cout<<(n&(1LL<<i))<<endl;
//    return (n&(1LL<<i))?1:0;
//}
//
//template <typename T>
//int findbits(T n, T p){
//    int x=0;
//    while(n>0){
//        n/=p;
//        x++;
//    }
//    return x;
//}

//
//
////
//vector<pair<lli,int>> v;
//void primeFactors(lli n)
//{
//    v.clear();
//    int c=0;
//    while (n % 2 == 0)
//    {
//        n = n/2;
//        c++;
//    }
//    if(c>0) v.pb({2,c});
//
//
//    for (lli i = 3; i*i <= n; i = i + 2)
//    {   c=0;
//
//        while (n % i == 0)
//        {
//            n = n/i;
//            c++;
//        }
//        if(c>0)v.pb({i,c});
//
//    }
//    if (n > 2)
//        v.pb({n,1});
//}

//lli fac_[N];
//void fac_init(int n){
//    fac_[0]=1;
//    loop(i,1,n+1)fac_[i]=modpro(fac_[i-1],i);
//}
//
/*BITMASK
for( int inum = 0 ; inum < ( 1 << n ) ; ++ inum ) {
     for ( int pos = 0; pos < n ; ++pos ) {
         if (  inum & ( 1 << pos )  ){
              results[inum] += s [pos] ; //DO SOMETHING
         }
     }
}
*/
Lf m[N],M[N],a[N],b[N];
int main(){
    fastIO;
    int erer=1;
//    cin>>erer;
    loop(erer2,1,erer+1){
        int n;
        cin>>n;
        loop(i,1,n+1) {cin>>M[i]; }
        loop(i,1,n+1) {cin>>m[i]; }
        Lf ta=1,tb=1;
        a[n]=1;
        b[n]=1;
        loop(i,1,n+1) M[i] = M[i-1]+M[i];
        loopr(i,n+1,1) m[i] = m[i+1]+m[i];

        loop(i,1,n){
            Lf sum = ((Lf)1-m[i+1]+M[i]);
            Lf pro = M[i];
//            o4(m[i+1],M[i],sum,pro);
            Lf D = sqrt(sum*sum - pro*4);
            Lf x1 = (sum + D)/2;
            Lf x2 = (sum - D)/2;
            if(x1 >= a[i-1] && x2 >= b[i-1]){
                a[i]=x1;
                b[i]=x2;
            }
            else a[i]=x2,b[i]=x1;
        }

        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<a[i]-a[i-1]<<" ";cl;
        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<b[i]-b[i-1]<<" ";

    }
    return 0;
}


#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int uli;
typedef long double Lf;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define fastIO  std::ios::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007
#define N 100005
#define NN 2005
#define SZ(x) ((lli) (x).size())
#define loop(i,s,n) for(int i=(s);i<(n);i++)
#define loopr(i,n,s) for(int i=(n)-1;i>=(s);i--)
#define pb push_back
#define o2(a,b) cout<<(a)<<" "<<(b)<<endl
#define o3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define o4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define cl cout<<endl
#define r0 return 0
#define e0 exit(0)
#define x first
#define y second

inline lli modadd(lli n,lli m,lli p=mod){
    return ((n+m)%p+p)%p;
}

inline lli modsub(lli n,lli m,lli p=mod){
    return ((n-m+p)%p+p)%p;
}

inline lli modpro(lli n,lli m,lli p=mod){
    return (((n%p)*(m%p))%p+p)%p;
}

uli powe(lli x,lli y){
    uli res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

lli modpow(lli x,lli y,lli p=mod){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x, p);
        y = y >> 1;
        x = modpro(x , x, p);
    }
    return res;
}

inline lli modInverse(lli n, lli p=mod)
{
    if(n==1) return 1;
    return modpow(n, p-2, p);
}

inline lli moddiv(lli n,lli m,lli p=mod){
    return modpro(n,modInverse(m,p),p);
}

inline lli modadd3(lli x, lli y, lli z,lli p=mod){
    return modadd(modadd(x,y,p),z,p);
}

inline lli modadd4(lli x, lli y, lli z, lli w,lli p=mod){
    return modadd(modadd(x,y,p),modadd(z,w,p),p);
}

inline lli modnCr(lli fac[], int n, int r, lli p=mod)
{
    if (r==0) return 1;
    return modpro(fac[n],modInverse(modpro(fac[r],fac[n-r],p),p),p);
}

template <typename T>
inline T max3(T x, T y, T z){
    return max(max(x,y),z);
}

template <typename T>
inline T max4(T x, T y, T z, T w){
    return max(max3(x,y,w),z);
}

template <typename T>
inline T min3(T x, T y, T z){
    return min(min(x,y),z);
}

template <typename T>
inline T min4(T x, T y, T z, T w){
    return min(min3(x,y,w),z);
}

template <typename T>
void printArr(T *arr, int s, int n){
    for(int i=s;i<=n;i++){

        cout<<arr[i]<<" ";
    }cout<<endl;
}

//template<class X, class Y, class Z>
//struct triple {
//    X x;
//    Y y;
//    Z z;
//
//     friend bool operator<(triple a, triple b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else return a.z<=b.z;
//    }
//};
//
//
//template<class X, class Y, class Z, class W>
//class quad {
//    public:
//    X x;
//    Y y;
//    Z z;
//    W w;
//
//     friend bool operator<(quad a, quad b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else if(a.z!=b.z)return a.z<b.z;
//        else return a.w<b.w;
//    }
//};

//template <typename T>
//T gcd(T a, T b)
//{
//    if (a == 0)
//        return b;
//    if(b==0)
//        return a;
//    T t;
//    while((a>0)&&(b>0)){
//     t = a;
//     a=b%a;
//     b=t;
// }
//
// return max(a,b);
//}

//
//uli choose(uli n, uli k){
//uli res = 1;
//
//    // Since C(n, k) = C(n, n-k)
//    if ( k > n - k )
//        k = n - k;
//
//    // Calculate value of
//    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
//    for (uli i = 0; i < k; ++i)
//    {
//        res *= (n - i);
//        res /= (i + 1);
//    }
//
//    return res;
//}
//

//
//  vector<vector<pii>> adj;
//   //vector<int> dist;
//   vector<int> d;
////   vector<bool> visited;
////     vector<int> pa;
//   //queue<int> q;
//
//  class Graph{
//
//   public:
//      int V;
//
//  Graph(int V){
//      this->V = V;
//      adj.resize(V);
////        visited.resize(V);
//      //color.resize(V);
//      //dist.resize(V);
//        d.resize(V);
//     //// dist.resize(V);
////     pa.resize(V);
//
//  }
//
//  ~Graph(){
// 	  adj.clear();
// 	  //visited.clear();
// 	 // color.clear();
// 	 // dist.clear();
////    pa.clear();
// 	  //dist.clear();
//// 	  visited.clear();
//d.clear();
//
//
//  }
//
//
//  void addEdge(int a, int b)
//  {
//      adj[a].pb(b);
//      adj[b].pb(a);
//      //adj[b].pb({a,in});
//  }
//
// //  void dfs(int x){
// //    //  color[x]=1;
// //   visited[x]=1;
// //      for(auto u: adj[x]){
// //          if(visited[u]) continue;
// //
// //          dfs(u);
// //      }
// //
// //  }
// //
// //
// //
// //
// //
//  // void dfsTree(int x, int p){
//  //     for(auto u: adj[x]){
//  //         if(u==p) {continue;}
//  //         dfsTree(u,x);
//  //     }
//  // }
//
//
//void dijkstra(int s) {
//    d.assign(n, INF);
//    d[s] = 0;
//    set<pair<int, int>> q;
//    q.insert({0, s});
//    while (!q.empty()) {
//        int v = q.begin()->second;
//        q.erase(q.begin());
//        for (auto edge : adj[v]) {
//            int to = edge.first;
//            int len = edge.second;
//            if (d[v] + len < d[to]) {
//                q.erase({d[to], to});
//                d[to] = d[v] + len;
//                q.insert({d[to], to});
//            }
//        }
//    }
//}
//
//
////  void bfs(int x){
////      queue<int> q;
////      visited[x]=1;
////      q.push(x);
////      //dist[x]=0;
////      while(!q.empty()){
////          int s = q.front();
////          q.pop();
////
////          for(auto u : adj[s]){
////
////              if(visited[u]) continue;
////              pa[u]=s;
////              visited[u]=1;
////              //dist[u.x]=dist[s]+1;
////              q.push(u);
////          }
////      }
////  }
//
// //pair<int,int> farthest(int start){
// //    vector<int> dist(V,INT_MAX);
// //
// //    q.push(start);
// //    dist[start]=0;
// //    while(!q.empty()){
// //        int u = q.front();
// //        q.pop();
// //        for(int child: adj[u]){
// //            //if(keep[child])
// //            if(dist[child] > dist[u]+1) {
// //                dist[child] = dist[u]+1;
// //                q.push(child);
// //            }
// //        }
// //    }
// //    int big=-1,mi=-1;
// //    for(int i=1;i<n+1;i++){
// //        //if(keep[i])
// //        {
// //            if(dist[i]>big){
// //                big=dist[i];mi=i;
// //            }
// //        }
// //    }
// //    return make_pair(big,mi);
// //}
//
//
// //  int connectedcomponents(int n){
// //      int ans=0;
// //      loop(i,1,n+1){
// //          if(!visited[i]){
// //              ans++;
// //              dfs(i);
// //          }
// //
// //      }
// //      return ans;
// //  }
//
//  };

//template <typename T>
//T findpowerfactorial(T n,T p)
//{
//    T x = 0;
//    while (n)
//    {
//        n /= p;
//        x += n;
//    }
//    return x;
//}
//
//template <typename T>
//int getibit(T n, int i){
//    //cout<<(n&(1LL<<i))<<endl;
//    return (n&(1LL<<i))?1:0;
//}
//
//template <typename T>
//int findbits(T n, T p){
//    int x=0;
//    while(n>0){
//        n/=p;
//        x++;
//    }
//    return x;
//}

//
//
////
//vector<pair<lli,int>> v;
//void primeFactors(lli n)
//{
//    v.clear();
//    int c=0;
//    while (n % 2 == 0)
//    {
//        n = n/2;
//        c++;
//    }
//    if(c>0) v.pb({2,c});
//
//
//    for (lli i = 3; i*i <= n; i = i + 2)
//    {   c=0;
//
//        while (n % i == 0)
//        {
//            n = n/i;
//            c++;
//        }
//        if(c>0)v.pb({i,c});
//
//    }
//    if (n > 2)
//        v.pb({n,1});
//}

//lli fac_[N];
//void fac_init(int n){
//    fac_[0]=1;
//    loop(i,1,n+1)fac_[i]=modpro(fac_[i-1],i);
//}
//
/*BITMASK
for( int inum = 0 ; inum < ( 1 << n ) ; ++ inum ) {
     for ( int pos = 0; pos < n ; ++pos ) {
         if (  inum & ( 1 << pos )  ){
              results[inum] += s [pos] ; //DO SOMETHING
         }
     }
}
*/
Lf m[N],M[N],a[N],b[N];
int main(){
    fastIO;
    int erer=1;
//    cin>>erer;
    loop(erer2,1,erer+1){
        int n;
        cin>>n;
        loop(i,1,n+1) {cin>>M[i]; }
        loop(i,1,n+1) {cin>>m[i]; }
        Lf ta=1,tb=1;
        a[n]=1;
        b[n]=1;
        loop(i,1,n+1) M[i] = M[i-1]+M[i];
        loopr(i,n+1,1) m[i] = m[i+1]+m[i];

        loop(i,1,n){
            Lf sum = ((Lf)1-m[i+1]+M[i]);
            Lf pro = M[i];
//            o4(m[i+1],M[i],sum,pro);
            Lf D = sqrt(sum*sum - pro*4);
            Lf x1 = (sum + D)/2;
            Lf x2 = (sum - D)/2;
            if(x1 >= a[i-1] && x2 >= b[i-1]){
                a[i]=x1;
                b[i]=x2;
            }
            else a[i]=x2,b[i]=x1;
        }

        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<max(0.0,a[i]-a[i-1])<<" ";cl;
        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<max(0.0,b[i]-b[i-1])<<" ";

    }
    return 0;
}


#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int uli;
typedef long double Lf;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define fastIO  std::ios::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007
#define N 100005
#define NN 2005
#define SZ(x) ((lli) (x).size())
#define loop(i,s,n) for(int i=(s);i<(n);i++)
#define loopr(i,n,s) for(int i=(n)-1;i>=(s);i--)
#define pb push_back
#define o2(a,b) cout<<(a)<<" "<<(b)<<endl
#define o3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define o4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define cl cout<<endl
#define r0 return 0
#define e0 exit(0)
#define x first
#define y second

inline lli modadd(lli n,lli m,lli p=mod){
    return ((n+m)%p+p)%p;
}

inline lli modsub(lli n,lli m,lli p=mod){
    return ((n-m+p)%p+p)%p;
}

inline lli modpro(lli n,lli m,lli p=mod){
    return (((n%p)*(m%p))%p+p)%p;
}

uli powe(lli x,lli y){
    uli res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}

lli modpow(lli x,lli y,lli p=mod){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x, p);
        y = y >> 1;
        x = modpro(x , x, p);
    }
    return res;
}

inline lli modInverse(lli n, lli p=mod)
{
    if(n==1) return 1;
    return modpow(n, p-2, p);
}

inline lli moddiv(lli n,lli m,lli p=mod){
    return modpro(n,modInverse(m,p),p);
}

inline lli modadd3(lli x, lli y, lli z,lli p=mod){
    return modadd(modadd(x,y,p),z,p);
}

inline lli modadd4(lli x, lli y, lli z, lli w,lli p=mod){
    return modadd(modadd(x,y,p),modadd(z,w,p),p);
}

inline lli modnCr(lli fac[], int n, int r, lli p=mod)
{
    if (r==0) return 1;
    return modpro(fac[n],modInverse(modpro(fac[r],fac[n-r],p),p),p);
}

template <typename T>
inline T max3(T x, T y, T z){
    return max(max(x,y),z);
}

template <typename T>
inline T max4(T x, T y, T z, T w){
    return max(max3(x,y,w),z);
}

template <typename T>
inline T min3(T x, T y, T z){
    return min(min(x,y),z);
}

template <typename T>
inline T min4(T x, T y, T z, T w){
    return min(min3(x,y,w),z);
}

template <typename T>
void printArr(T *arr, int s, int n){
    for(int i=s;i<=n;i++){

        cout<<arr[i]<<" ";
    }cout<<endl;
}

//template<class X, class Y, class Z>
//struct triple {
//    X x;
//    Y y;
//    Z z;
//
//     friend bool operator<(triple a, triple b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else return a.z<=b.z;
//    }
//};
//
//
//template<class X, class Y, class Z, class W>
//class quad {
//    public:
//    X x;
//    Y y;
//    Z z;
//    W w;
//
//     friend bool operator<(quad a, quad b)
//    {
//        if(a.x!=b.x) return a.x<b.x;
//        else if(a.y!=b.y) return a.y<b.y;
//        else if(a.z!=b.z)return a.z<b.z;
//        else return a.w<b.w;
//    }
//};

//template <typename T>
//T gcd(T a, T b)
//{
//    if (a == 0)
//        return b;
//    if(b==0)
//        return a;
//    T t;
//    while((a>0)&&(b>0)){
//     t = a;
//     a=b%a;
//     b=t;
// }
//
// return max(a,b);
//}

//
//uli choose(uli n, uli k){
//uli res = 1;
//
//    // Since C(n, k) = C(n, n-k)
//    if ( k > n - k )
//        k = n - k;
//
//    // Calculate value of
//    // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
//    for (uli i = 0; i < k; ++i)
//    {
//        res *= (n - i);
//        res /= (i + 1);
//    }
//
//    return res;
//}
//

//
//  vector<vector<pii>> adj;
//   //vector<int> dist;
//   vector<int> d;
////   vector<bool> visited;
////     vector<int> pa;
//   //queue<int> q;
//
//  class Graph{
//
//   public:
//      int V;
//
//  Graph(int V){
//      this->V = V;
//      adj.resize(V);
////        visited.resize(V);
//      //color.resize(V);
//      //dist.resize(V);
//        d.resize(V);
//     //// dist.resize(V);
////     pa.resize(V);
//
//  }
//
//  ~Graph(){
// 	  adj.clear();
// 	  //visited.clear();
// 	 // color.clear();
// 	 // dist.clear();
////    pa.clear();
// 	  //dist.clear();
//// 	  visited.clear();
//d.clear();
//
//
//  }
//
//
//  void addEdge(int a, int b)
//  {
//      adj[a].pb(b);
//      adj[b].pb(a);
//      //adj[b].pb({a,in});
//  }
//
// //  void dfs(int x){
// //    //  color[x]=1;
// //   visited[x]=1;
// //      for(auto u: adj[x]){
// //          if(visited[u]) continue;
// //
// //          dfs(u);
// //      }
// //
// //  }
// //
// //
// //
// //
// //
//  // void dfsTree(int x, int p){
//  //     for(auto u: adj[x]){
//  //         if(u==p) {continue;}
//  //         dfsTree(u,x);
//  //     }
//  // }
//
//
//void dijkstra(int s) {
//    d.assign(n, INF);
//    d[s] = 0;
//    set<pair<int, int>> q;
//    q.insert({0, s});
//    while (!q.empty()) {
//        int v = q.begin()->second;
//        q.erase(q.begin());
//        for (auto edge : adj[v]) {
//            int to = edge.first;
//            int len = edge.second;
//            if (d[v] + len < d[to]) {
//                q.erase({d[to], to});
//                d[to] = d[v] + len;
//                q.insert({d[to], to});
//            }
//        }
//    }
//}
//
//
////  void bfs(int x){
////      queue<int> q;
////      visited[x]=1;
////      q.push(x);
////      //dist[x]=0;
////      while(!q.empty()){
////          int s = q.front();
////          q.pop();
////
////          for(auto u : adj[s]){
////
////              if(visited[u]) continue;
////              pa[u]=s;
////              visited[u]=1;
////              //dist[u.x]=dist[s]+1;
////              q.push(u);
////          }
////      }
////  }
//
// //pair<int,int> farthest(int start){
// //    vector<int> dist(V,INT_MAX);
// //
// //    q.push(start);
// //    dist[start]=0;
// //    while(!q.empty()){
// //        int u = q.front();
// //        q.pop();
// //        for(int child: adj[u]){
// //            //if(keep[child])
// //            if(dist[child] > dist[u]+1) {
// //                dist[child] = dist[u]+1;
// //                q.push(child);
// //            }
// //        }
// //    }
// //    int big=-1,mi=-1;
// //    for(int i=1;i<n+1;i++){
// //        //if(keep[i])
// //        {
// //            if(dist[i]>big){
// //                big=dist[i];mi=i;
// //            }
// //        }
// //    }
// //    return make_pair(big,mi);
// //}
//
//
// //  int connectedcomponents(int n){
// //      int ans=0;
// //      loop(i,1,n+1){
// //          if(!visited[i]){
// //              ans++;
// //              dfs(i);
// //          }
// //
// //      }
// //      return ans;
// //  }
//
//  };

//template <typename T>
//T findpowerfactorial(T n,T p)
//{
//    T x = 0;
//    while (n)
//    {
//        n /= p;
//        x += n;
//    }
//    return x;
//}
//
//template <typename T>
//int getibit(T n, int i){
//    //cout<<(n&(1LL<<i))<<endl;
//    return (n&(1LL<<i))?1:0;
//}
//
//template <typename T>
//int findbits(T n, T p){
//    int x=0;
//    while(n>0){
//        n/=p;
//        x++;
//    }
//    return x;
//}

//
//
////
//vector<pair<lli,int>> v;
//void primeFactors(lli n)
//{
//    v.clear();
//    int c=0;
//    while (n % 2 == 0)
//    {
//        n = n/2;
//        c++;
//    }
//    if(c>0) v.pb({2,c});
//
//
//    for (lli i = 3; i*i <= n; i = i + 2)
//    {   c=0;
//
//        while (n % i == 0)
//        {
//            n = n/i;
//            c++;
//        }
//        if(c>0)v.pb({i,c});
//
//    }
//    if (n > 2)
//        v.pb({n,1});
//}

//lli fac_[N];
//void fac_init(int n){
//    fac_[0]=1;
//    loop(i,1,n+1)fac_[i]=modpro(fac_[i-1],i);
//}
//
/*BITMASK
for( int inum = 0 ; inum < ( 1 << n ) ; ++ inum ) {
     for ( int pos = 0; pos < n ; ++pos ) {
         if (  inum & ( 1 << pos )  ){
              results[inum] += s [pos] ; //DO SOMETHING
         }
     }
}
*/
Lf m[N],M[N],a[N],b[N];
const Lf eps = 1e-12;
int main(){
    fastIO;
    int erer=1;
//    cin>>erer;
    loop(erer2,1,erer+1){
        int n;
        cin>>n;
        loop(i,1,n+1) {cin>>M[i]; }
        loop(i,1,n+1) {cin>>m[i]; }
        Lf ta=1,tb=1;
        a[n]=1;
        b[n]=1;
        loop(i,1,n+1) M[i] = M[i-1]+M[i];
        loopr(i,n+1,1) m[i] = m[i+1]+m[i];

        loop(i,1,n){
            Lf sum = ((Lf)1-m[i+1]+M[i]);
            Lf pro = M[i];
//            o4(m[i+1],M[i],sum,pro);
            Lf D = sqrt(max((Lf)0,sum*sum - pro*4));
            Lf x1 = (sum + D)/2;
            Lf x2 = (sum - D)/2;
            if(x1 >= a[i-1] - eps && x2 >= b[i-1] - eps){
                a[i]=x1;
                b[i]=x2;
            }
            else a[i]=x2,b[i]=x1;
        }

        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<max((Lf)0,a[i]-a[i-1])<<" ";cl;
        loop(i,1,n+1) cout<<fixed<<setprecision(10)<<max((Lf)0,b[i]-b[i-1])<<" ";

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-9;
const ld meps=1e-17;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;
bool my=false;

void read(ld &val)
{
string s;
cin>>s;
bool was=false;
val=0;
ld con=1;
for (auto sy:s)
  {
  if (sy=='.')
    was=true;
  else
    {
    if (!was)
      {
      val*=10;
      val+=(sy-'0');
      }
    else
      {
      con/=10.0;
      val+=con*(sy-'0');
      }
    }
  }
if (viv)
  cout<<"read "<<s<<" is "<<val<<endl;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x)
{
if (viv)
  cout<<"CHEEEEEEEEEECK OF "<<x<<endl;
if (x>-eps)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(max(b*b-4*a*c, 0.0));
if (viv)
  cout<<"Discr = "<<d<<endl;
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1)&&ins(sum[i]-x1))
  return x1;
return x2;
}

void found(ll i)
{
b.push_back(solve(-1, suma-sumb+sum[i], sumb*sum[i]-pref[i]+suma*sumb, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

suma+=a[i];
sumb+=b[i];
}

void another()
{
cout<<"Ogo, give me input:"<<endl;
cin>>n;
vector <ld> mya, myb;
ld aca=1, acb=1;
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  aca-=a;
  mya.push_back(a);
  }
mya.push_back(aca);
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  acb-=a;
  myb.push_back(a);
  }
myb.push_back(acb);

vector <vector <ld>> f(n);
for (ll i=0; i<n; i++)
  for (auto val:myb)
    f[i].push_back(mya[i]*val);
ma.resize(n, 0);
mi.resize(n, 0);
for (ll i=0; i<n; i++)
  {
  for (ll j=0; j<n; j++)
    ma[max(i, j)]+=f[i][j],
    mi[min(i, j)]+=f[i][j];
  }

for (auto i:mya)
  cout<<i<<' ';
cout<<endl;
for (auto i:myb)
  cout<<i<<' ';
cout<<endl;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
//my=true;
cout.precision(20);
if (my)
  another();
else
  {
  cin>>n;
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    ma.push_back(a);
    }
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    mi.push_back(a);
    }
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}
/**
4
0.1 0.1 0.1
0.2 0.4 0.1

3
0.1 0.1
0.2 0.4

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 0;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1')
        return s[0] - '0';

    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
    pld rs = {(- b + d) / 2.0, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    vector<ld> pref;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];
    pref.push_back(sum[0]);
    for (ll i = 1; i < n; i++)
        pref.push_back(pref.back() + sum[i]);
    ld suma = 0;
    ld sumb = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        ld sumb = 0;
        if (i)
            sumb = pref[i-1] - suma;
        pld add = root(suma, sumb, sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        b.push_back(sum[i] - a.back());
        suma += a.back();
//        sumb += b.back();
        if (a.back() < 0 || b.back() < 0) {
            suma -= a.back();
//            sumb -= b.back();
            a.pop_back();
            b.pop_back();
            a.push_back(add.S);
            b.push_back(sum[i] - a.back());
            suma += a.back();
//            sumb += b.back();
        }
    }
    cout.precision(10);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << b[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-8;

ll n, i, j;
vector<ld> mx, mn, pmx, pmn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s[0] == '1')
        return 1;
    if (s.size() == 1)
        return 0;
    reverse(s.begin(), s.end());
    s.pop_back();
    s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

ld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (viv)
        cout << "Solve xx + " << b << "x + " << c << endl;

    ld d = sqrt(max(b * b - 4 * c, (ld)0));
    ld r1 = (-b + d) / 2;
    ld r2 = (-b - d) / 2;
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    if (r1 < -eps / 10 || r1 > s + eps / 10)
        r1 = r2;
    return r1;
}

void show(vector<ld> a, vector<ld> b) {
    vector<ld> mx, mn;
    mx.resize(a.size());
    mn.resize(a.size());
    for (ll i = 0; i < a.size(); i++)
        for (ll j = 0; j< b.size(); j++)
            mn[min(i, j)] += a[i] * b[j], mx[max(i, j)] += a[i] * b[j];
    for (auto i : mx)
        cout << i << ' ';
    cout << endl;
    for (auto i : mn)
        cout << i << ' ';
    cout << endl;
}
void prepare() {
    pmx.push_back(0);
    pmn.push_back(0);
    for (auto i : mx)
        pmx.push_back(pmx.back() + i);
    for (auto i : mn)
        pmn.push_back(pmn.back() + i);

    sum.push_back(0);
    for (ll i = 0; i < n; i++) {
        ld val = pmx[i + 1] + pmn[i + 1];
        sum.push_back(val);
    }
    for (ll i = n; i > 0; i--)
        sum[i] -= sum[i-1];
    if (viv) {
        for (auto i : sum)
            cout << i << ' ';
        cout << endl;
    }
    vector<ld> suma, sumb, a, b;
    suma.push_back(0);
    sumb.push_back(0);
    for (ll i = 0; i < n; i++) {
        ld val = root(suma[i], sumb[i], sum[i + 1], mx[i]);
        a.push_back(val);

        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
    }

    cout.precision(15);
    for (auto i : a)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : b)
        cout << fixed << i << ' ';
    cout << endl;
    if (viv)
        show(a, b);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (i = 0; i < n; i++)
        mx.push_back(read());
    for (i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
3
0.07 0.2 0.73
0.73 0.2 0.07

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-9;
const ld meps=1e-17;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;
bool my=false;

void read(ld &val)
{
    cin >> val;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x)
{
if (viv)
  cout<<"CHEEEEEEEEEECK OF "<<x<<endl;
if (x>-eps)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(max(b*b-4*a*c, (ld)0));
if (viv)
  cout<<"Discr = "<<d<<endl;
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1)&&ins(sum[i]-x1))
  return x1;
return x2;
}

void found(ll i)
{
b.push_back(solve(-1, suma-sumb+sum[i], sumb*sum[i]-pref[i]+suma*sumb, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

suma+=a[i];
sumb+=b[i];
}

void another()
{
cout<<"Ogo, give me input:"<<endl;
cin>>n;
vector <ld> mya, myb;
ld aca=1, acb=1;
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  aca-=a;
  mya.push_back(a);
  }
mya.push_back(aca);
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  acb-=a;
  myb.push_back(a);
  }
myb.push_back(acb);

vector <vector <ld>> f(n);
for (ll i=0; i<n; i++)
  for (auto val:myb)
    f[i].push_back(mya[i]*val);
ma.resize(n, 0);
mi.resize(n, 0);
for (ll i=0; i<n; i++)
  {
  for (ll j=0; j<n; j++)
    ma[max(i, j)]+=f[i][j],
    mi[min(i, j)]+=f[i][j];
  }

for (auto i:mya)
  cout<<i<<' ';
cout<<endl;
for (auto i:myb)
  cout<<i<<' ';
cout<<endl;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
//my=true;
cout.precision(20);
if (my)
  another();
else
  {
  cin>>n;
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    ma.push_back(a);
    }
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    mi.push_back(a);
    }
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-9;
const ld meps=1e-17;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;
bool my=false;

void read(ld &val)
{
string s;
cin>>s;
bool was=false;
val=0;
ld con=1;
for (auto sy:s)
  {
  if (sy=='.')
    was=true;
  else
    {
    if (!was)
      {
      val*=10;
      val+=(sy-'0');
      }
    else
      {
      con/=10.0;
      val+=con*(sy-'0');
      }
    }
  }
if (viv)
  cout<<"read "<<s<<" is "<<val<<endl;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x)
{
if (viv)
  cout<<"CHEEEEEEEEEECK OF "<<x<<endl;
if (x>0)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(max(b*b-4*a*c, (ld)0));
if (viv)
  cout<<"Discr = "<<d<<endl;
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1)&&ins(sum[i]-x1))
  return x1;
return x2;
}

void found(ll i)
{
b.push_back(solve(-1, suma-sumb+sum[i], sumb*sum[i]-pref[i]+suma*sumb, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

suma+=a[i];
sumb+=b[i];
}

void another()
{
cout<<"Ogo, give me input:"<<endl;
cin>>n;
vector <ld> mya, myb;
ld aca=1, acb=1;
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  aca-=a;
  mya.push_back(a);
  }
mya.push_back(aca);
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  acb-=a;
  myb.push_back(a);
  }
myb.push_back(acb);

vector <vector <ld>> f(n);
for (ll i=0; i<n; i++)
  for (auto val:myb)
    f[i].push_back(mya[i]*val);
ma.resize(n, 0);
mi.resize(n, 0);
for (ll i=0; i<n; i++)
  {
  for (ll j=0; j<n; j++)
    ma[max(i, j)]+=f[i][j],
    mi[min(i, j)]+=f[i][j];
  }

for (auto i:mya)
  cout<<i<<' ';
cout<<endl;
for (auto i:myb)
  cout<<i<<' ';
cout<<endl;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
//my=true;
cout.precision(20);
if (my)
  another();
else
  {
  cin>>n;
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    ma.push_back(a);
    }
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    mi.push_back(a);
    }
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}
/**
4
0.1 0.1 0.1
0.2 0.4 0.1

3
0.1 0.1
0.2 0.4

**/


#include <bits/stdc++.h>

#pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-7;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1') return s[0] - '0';
    s.erase(s.begin());
    s.erase(s.begin());
    s.resize(9, '0');
    ld ans = atoi(s.c_str());
    ans /= 1e9;
    return ans;
}

pld root(ld sa, ld sab, ld s, ld mx) {
//    ld sb = sab - sa;
    ld b = 2*sa - sab - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
//    ld d = sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)));
    pld rs = {(- b + d) / 2, 0};
//    pld rs = {(- b + sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)))) / 2, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];

    vector<ld> pref;
    pref.push_back(0);
    for (ll i = 0; i < n; i++)
        pref.push_back(pref.back() + sum[i]);

    ld suma = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, pref[i], sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        suma += a.back();
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(add.S);
            suma += a.back();
        }
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(0);
            suma += a.back();
        }
    }
    cout.precision(15);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << sum[i] - a[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-10;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1')
        return s[0] - '0';

    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
    pld rs = {(- b + d) / 2.0, (- b - d) / 2.0};
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];
    ld suma = 0;
    ld sumb = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, sumb, sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        b.push_back(sum[i] - a.back());
        suma += a.back();
        sumb += b.back();
        if (suma > 1 || sumb > 1 || a.back() < 0 || b.back() < 0) {
            suma -= a.back();
            sumb -= b.back();
            a.pop_back();
            b.pop_back();
            a.push_back(add.S);
            b.push_back(sum[i] - a.back());
            suma += a.back();
            sumb += b.back();
        }
        if (suma > 1 || sumb > 1 || a.back() < 0 || b.back() < 0) {
            suma -= a.back();
            sumb -= b.back();
            a.pop_back();
            b.pop_back();
            a.push_back(add.F);
            b.push_back(sum[i] - a.back());
            suma += a.back();
            sumb += b.back();
        }
    }
    cout.precision(10);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << b[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

#pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-7;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1')
        return s[0] - '0';

    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

pld root(ld sa, ld sab, ld s, ld mx) {
//    ld sb = sab - sa;
    ld b = 2*sa - sab - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
//    ld d = sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)));
    pld rs = {(- b + d) / 2, 0};
//    pld rs = {(- b + sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)))) / 2, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];

    vector<ld> pref;
    pref.push_back(0);
    for (ll i = 0; i < n; i++)
        pref.push_back(pref.back() + sum[i]);

    ld suma = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, pref[i], sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        suma += a.back();
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(add.S);
            suma += a.back();
        }
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            ll z = 0;
            while (true || !false)
                cout << "Go to hell" << endl, z++;
            exit(0);
        }
    }
    cout.precision(15);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << sum[i] - a[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-9;
const ld meps=1e-17;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;

void read(ld &val)
{
string s;
cin>>s;
bool was=false;
val=0;
ld con=1;
for (auto sy:s)
  {
  if (sy=='.')
    was=true;
  else
    {
    if (!was)
      {
      val*=10;
      val+=(sy-'0');
      }
    else
      {
      con/=10.0;
      val+=con*(sy-'0');
      }
    }
  }
if (viv)
  cout<<"read "<<s<<" is "<<val<<endl;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x, ll i)
{
if (x>-eps&&x<sum[i]+eps)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(b*b-4*a*c);
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1, i))
  return x1;
return x2;
}

void found(ll i)
{
ld s=suma*sumb;
b.push_back(solve(-1, suma-sumb+sum[i], (sumb-suma)*sum[i]-pref[i]+s+sum[i]*suma, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

suma+=a[i];
sumb+=b[i];
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
cout.precision(20);
cin>>n;
for (i=0; i<n; i++)
  {
  ld a;
  read(a);
  ma.push_back(a);
  }
for (i=0; i<n; i++)
  {
  ld a;
  read(a);
  mi.push_back(a);
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 0;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1')
        return s[0] - '0';

    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
//    ld d = sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)));
//    pld rs = {(- b + d) / 2, 0};
    pld rs = {(- b + sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)))) / 2, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];

    vector<ld> pref;
    pref.push_back(0);
    for (ll i = 0; i < n; i++)
        pref.push_back(pref.back() + sum[i]);

    ld suma = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, pref[i] - suma, sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        suma += a.back();
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(add.S);
            suma += a.back();
        }
    }
    cout.precision(15);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << sum[i] - a[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-10;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s.size() == 1)
        return s[0] - '0';
    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrt(max((ld)0, b * b - 4 * c));
    pld rs = {(- b + d) / 2.0, (- b - d) / 2.0};
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = 0;
    if (abs(rs.S - s) < eps)
        rs.S = 0;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];
    ld suma = 0;
    ld sumb = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, sumb, sum[i], mx[i]);
        a.push_back(add.F);
        b.push_back(sum[i] - a.back());
        suma += a.back();
        sumb += b.back();
        if (suma > 1 || sumb > 1 || a.back() < 0 || b.back() < 0) {
            suma -= a.back();
            sumb -= b.back();
            a.pop_back();
            b.pop_back();
            a.push_back(add.S);
            b.push_back(sum[i] - a.back());
            suma += a.back();
            sumb += b.back();
        }
    }
    cout.precision(10);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << b[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-15;
const ld meps=0;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;
bool my=false;

void read(ld &val)
{
string s;
cin>>s;
bool was=false;
val=0;
ld con=1;
for (auto sy:s)
  {
  if (sy=='.')
    was=true;
  else
    {
    if (!was)
      {
      val*=10;
      val+=(sy-'0');
      }
    else
      {
      con/=10.0;
      val+=con*(sy-'0');
      }
    }
  }
if (viv)
  cout<<"read "<<s<<" is "<<val<<endl;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x)
{
if (viv)
  cout<<"CHEEEEEEEEEECK OF "<<x<<endl;
if (x>-eps)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(max(b*b-4*a*c, (ld)0));
if (viv)
  cout<<"Discr = "<<d<<endl;
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1)&&ins(sum[i]-x1))
  return x1;
return x2;
}

void found(ll i)
{
b.push_back(solve(-1, suma-sumb+sum[i], sumb*sum[i]-pref[i]+suma*sumb, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

a[i]=max(a[i], 0);
b[i]=max(b[i], 0);
a[i]=min(a[i], 1);
b[i]=min(b[i], 1);

suma+=a[i];
sumb+=b[i];
}

void another()
{
cout<<"Ogo, give me input:"<<endl;
cin>>n;
vector <ld> mya, myb;
ld aca=1, acb=1;
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  aca-=a;
  mya.push_back(a);
  }
mya.push_back(aca);
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  acb-=a;
  myb.push_back(a);
  }
myb.push_back(acb);

vector <vector <ld>> f(n);
for (ll i=0; i<n; i++)
  for (auto val:myb)
    f[i].push_back(mya[i]*val);
ma.resize(n, 0);
mi.resize(n, 0);
for (ll i=0; i<n; i++)
  {
  for (ll j=0; j<n; j++)
    ma[max(i, j)]+=f[i][j],
    mi[min(i, j)]+=f[i][j];
  }

for (auto i:mya)
  cout<<i<<' ';
cout<<endl;
for (auto i:myb)
  cout<<i<<' ';
cout<<endl;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
//my=true;
cout.precision(20);
if (my)
  another();
else
  {
  cin>>n;
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    ma.push_back(a);
    }
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    mi.push_back(a);
    }
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}
/**
4
0.1 0.1 0.1
0.2 0.4 0.1

3
0.1 0.1
0.2 0.4

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;

ll n, i, j;
vector<ld> mx, mn, pmx, pmn, sum;
bool viv = false;

ld read() {
    string s;
    cin >> s;
    if (s[0] == '1')
        return 1;
    if (s.size() == 1)
        return 0;
    reverse(s.begin(), s.end());
    s.pop_back();
    s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
    return res;
}

ld root(ld sa, ld sb, ld s, ld mx) {
    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (viv)
        cout << "Solve xx + " << b << "x + " << c << endl;

    ld d = sqrt(max(b * b - 4 * c, (ld)0));
    ld r1 = (-b + d) / 2;
    ld r2 = (-b - d) / 2;
    if (r1 < 0 || r1 > s)
        r1 = r2;
    return r1;
}

void prepare() {
    pmx.push_back(0);
    pmn.push_back(0);
    for (auto i : mx)
        pmx.push_back(pmx.back() + i);
    for (auto i : mn)
        pmn.push_back(pmn.back() + i);

    sum.push_back(0);
    for (ll i = 0; i < n; i++) {
        ld val = pmx[i + 1] + pmn[i + 1];
        sum.push_back(val);
    }
    for (ll i = n; i > 0; i--)
        sum[i] -= sum[i-1];
    if (viv) {
        for (auto i : sum)
            cout << i << ' ';
        cout << endl;
    }
    vector<ld> suma, sumb, a, b;
    suma.push_back(0);
    sumb.push_back(0);
    for (ll i = 0; i < n; i++) {
        a.push_back(root(suma[i], sumb[i], sum[i + 1], mx[i]));
        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
    }

    cout.precision(15);
    for (auto i : a)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : b)
        cout << fixed << i << ' ';
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (i = 0; i < n; i++)
        mx.push_back(read());
    for (i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
3
0.07 0.2 0.73
0.73 0.2 0.07

**/


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=ml*ml*ml+7;
const ld eps=1e-9;
const ld meps=1e-17;

ll n,i,j;
ld suma, sumb;
vector <ld> mi, ma, sum, a, b, pref;
bool viv=false;
bool my=false;

void read(ld &val)
{
string s;
cin>>s;
bool was=false;
val=0;
ld con=1;
for (auto sy:s)
  {
  if (sy=='.')
    was=true;
  else
    {
    if (!was)
      {
      val*=10;
      val+=(sy-'0');
      }
    else
      {
      con/=10.0;
      val+=con*(sy-'0');
      }
    }
  }
if (viv)
  cout<<"read "<<s<<" is "<<val<<endl;
}

void sums(ll k)
{
ld lsum=ma[k]+mi[k];
sum.push_back(lsum);
}

void prefs()
{
pref.push_back(ma[0]);
for (ll i=1; i<n; i++)
  pref.push_back(pref.back()+ma[i]);
if (viv)
  {
  cout<<"Prefs: ";
  for (auto i:pref)
    cout<<i<<' ';
  cout<<endl;
  }
}

bool ins(ld x)
{
if (viv)
  cout<<"CHEEEEEEEEEECK OF "<<x<<endl;
if (x>-eps)
  return true;
return false;
}

ld solve(ld a, ld b, ld c, ll i)
{
if (viv)
  cout<<"Try to solve with: "<<a<<' '<<b<<' '<<c<<endl;

ld d=sqrt(max(b*b-4*a*c, (ld)0));
if (viv)
  cout<<"Discr = "<<d<<endl;
ld x1=(-b+d)/(2.0*a);
ld x2=(-b-d)/(2.0*a);
if (viv)
  cout<<"Get "<<x1<<' '<<x2<<endl;
if (ins(x1)&&ins(sum[i]-x1))
  return x1;
return x2;
}

void found(ll i)
{
b.push_back(solve(-1, suma-sumb+sum[i], sumb*sum[i]-pref[i]+suma*sumb, i));
a.push_back(sum[i]-b[i]);

if (viv)
  cout<<"Ogo "<<a[i]<<' '<<b[i]<<endl;

suma+=a[i];
sumb+=b[i];
}

void another()
{
cout<<"Ogo, give me input:"<<endl;
cin>>n;
vector <ld> mya, myb;
ld aca=1, acb=1;
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  aca-=a;
  mya.push_back(a);
  }
mya.push_back(aca);
for (ll i=0; i<n-1; i++)
  {
  ld a;
  read(a);
  acb-=a;
  myb.push_back(a);
  }
myb.push_back(acb);

vector <vector <ld>> f(n);
for (ll i=0; i<n; i++)
  for (auto val:myb)
    f[i].push_back(mya[i]*val);
ma.resize(n, 0);
mi.resize(n, 0);
for (ll i=0; i<n; i++)
  {
  for (ll j=0; j<n; j++)
    ma[max(i, j)]+=f[i][j],
    mi[min(i, j)]+=f[i][j];
  }

for (auto i:mya)
  cout<<i<<' ';
cout<<endl;
for (auto i:myb)
  cout<<i<<' ';
cout<<endl;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//viv=true;
//my=true;
cout.precision(20);
if (my)
  another();
else
  {
  cin>>n;
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    ma.push_back(a);
    }
  for (i=0; i<n; i++)
    {
    ld a;
    read(a);
    mi.push_back(a);
    }
  }

for (ll i=0; i<n; i++)
  sums(i);
if (viv)
  {
  cout<<"Sums: ";
  for (auto i:sum)
    cout<<i<<' ';
  cout<<endl;
  }
prefs();

for (ll i=0; i<n; i++)
  found(i);
for (auto &i:a)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);
for (auto &i:b)
  i=max(i, (ld)0+meps),
  i=min(i, (ld)1-meps);

for (auto i:a)
  cout<<fixed<<i<<' ';
cout<<endl;
for (auto i:b)
  cout<<fixed<<i<<' ';
cout<<endl;

    return 0;
}
/**
4
0.1 0.1 0.1
0.2 0.4 0.1

3
0.1 0.1
0.2 0.4

**/


#include <bits/stdc++.h>

#pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

ifstream in;
ofstream out;

const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const ld eps = 1e-7;

ll n, con;
vector<ld> mx, mn, sum;
bool viv = false;

ld read() {
/**
    string s;
    cin >> s;
    if (s.size() == 1 || s[0] == '1')
        return s[0] - '0';

    reverse(s.begin(), s.end());
    s.pop_back(), s.pop_back();
    ld res = 0;
    for (auto i : s)
        res += (i - '0'), res /= 10;
**/
    ld res;
    cin >> res;
    return res;
}

pld root(ld sa, ld sab, ld s, ld mx) {
//    ld sb = sab - sa;
    ld b = 2*sa - sab - s;
    ld c = mx - s * sa;
    cout.precision(20);
    ld d = sqrtl(max((ld)0, b * b - 4 * c));
//    ld d = sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)));
    pld rs = {(- b + d) / 2, 0};
//    pld rs = {(- b + sqrtl(max((ld)0, (sa - sb - s) * (sa - sb - s) - 4 * (mx - s * sa)))) / 2, 0};
    rs.S = -b - rs.F;
    if (abs(rs.F) < eps)
        rs.F = 0;
    if (abs(rs.S) < eps)
        rs.S = 0;
    if (abs(rs.F - s) < eps)
        rs.F = s;
    if (abs(rs.S - s) < eps)
        rs.S = s;
    return rs;
}

void prepare() {
    sum = mn;
    for (ll i = 0; i < n; i++)
        sum[i] += mx[i];

    vector<ld> pref;
    pref.push_back(0);
    for (ll i = 0; i < n; i++)
        pref.push_back(pref.back() + sum[i]);

    ld suma = 0;
    vector<ld> a, b;
    for (ll i = 0; i < n; i++) {
        pld add = root(suma, pref[i], sum[i], mx[i]);
//        cout << add.F << ' ' << add.S << endl;
        if (viv)
            cout << "__ " << add.F << ' ' << add.S << endl;
        a.push_back(add.F);
        suma += a.back();
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(add.S);
            suma += a.back();
        }
        if (a.back() < 0 || sum[i] - a.back() < 0) {
            suma -= a.back();
            a.pop_back();
            a.push_back(0);
            suma += a.back();
        }
    }
    cout.precision(15);
    for (ll i = 0; i < n; i++)
        cout << fixed << a[i]<< ' ';
    cout << endl;
    for (ll i = 0; i < n; i++)
        cout << fixed << sum[i] - a[i] << ' ';
    cout << endl;
}

int main() {
//    freopen("ex.txt", "r", stdin);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for (ll i = 0; i < n; i++)
        mx.push_back(read());
    for (ll i = 0; i < n; i++)
        mn.push_back(read());
    prepare();

    return 0;
}
/**
10
0.10 0.02 0.04 0.69 0.01 0.01 0.06 0.02 0.03 0.02
1 0 0 0 0 0 0 0 0 0

3
0.07 0.2 0.73
0.73 0.2 0.07

3
0.02 0.22 0.76
0.28 0.58 0.14

6
0.001 0.0035 0.3843 0.11 0.1837 0.3175
0.109 0.0665 0.6957 0.07 0.0363 0.0225

10
0.00022404 0.00074752 0.00196930 0.00393592 0.00255606 0.00436464 0.00217638 0.00245083 0.00950300 0.97207230
0.03596096 0.02540748 0.04472470 0.05320308 0.02658194 0.03841636 0.01653562 0.01777117 0.05187200 0.68952670

**/