#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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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);

swap(a, b);

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;
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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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;
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 = 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 = 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) return s[0] - '0';
    reverse(s.begin(), s.end());
    ld ans = 0;
    for (auto i : s) {
        if (i == '.') {
            break;
        }
        ans += i - '0';
        ans /= 10;
    }
    ans += s.back() - '0';
    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 = 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 = 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();
        }
    }
    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-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 = 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;
}
/**
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 = 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, (- 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>

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-16;

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 (abs(r2) < eps)
        r2 = 0;
    if (abs(r2 - s) < eps)
        r2 = s;
    if (r1 < -eps / 10 || r1 > s + eps / 10)
        return r2;
    if (r2 < -eps / 10 || r2 > s + eps / 10)
        return r1;
    r1 = min(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

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

**/


#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;
    reverse(s.begin(), s.end());
    ld ans = 0;
    for (auto i : s) {
        if (i == '.') {
            break;
        }
        ans += i - '0';
        ans /= 10;
    }
    ans += s.back() - '0';
    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, i, j, cnt;
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;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    if (viv)
        cout << "Step " << cnt << endl, cnt++;

    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (b > 0 && viv) {
        cout << "Shit, their sum ";
        cout.precision(20);
        cout << b << endl;
//        exit(0);
    }

    if (viv && b * b - 4 * c < -eps) {
        cout.precision(20);
        cout << "Jopa " << fixed << b * b - 4 * c << endl;
        cout << "Jopa " << fixed << -eps * 100 << endl;
//        exit(0);
    }
    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 (abs(r2) < eps)
        r2 = 0;
    if (abs(r2 - s) < eps)
        r2 = s;
    if (viv && min(r1, r2) < -eps) {
        cout.precision(20);
        cout << "Hellll " << fixed << s << ' ' << r1 << ' ' << r2 << endl;
//        exit(0);
    }
    return {r1, r2};
}

void show(vector<ld> a, vector<ld> b) {
    cout << "So, is it: \n";
    vector<ld> lmx, lmn;
    lmx.resize(a.size());
    lmn.resize(a.size());
    cout.precision(8);
    for (ll i = 0; i < a.size(); i++)
        for (ll j = 0; j< b.size(); j++)
            lmn[min(i, j)] += a[i] * b[j], lmx[max(i, j)] += a[i] * b[j];
    for (auto i : lmx)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : lmn)
        cout << fixed << i << ' ';
    cout << endl;

    for (ll i = 0; i < n; i++) {
        lmx[i] -= mx[i];
        lmn[i] -= mn[i];
    }
    vector<ld> all;
    for (auto i : lmx)
        all.push_back(i);
    for (auto i : lmn)
        all.push_back(i);
    sort(all.begin(), all.end());

    cout << "Delta: ";
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[i] << ' ';
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[all.size() - 1 - 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];
        ld val = mx[i] + mn[i];
        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++) {
        pld val = root(suma[i], sumb[i], sum[i + 1], mx[i]);
        a.push_back(val.F);

        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
        if (a.back() < 0 || b.back() < 0 || sumb.back() > 1 || suma.back() > 1) {
            sumb.pop_back();
            suma.pop_back();
            b.pop_back();
            a.pop_back();
            a.push_back(val.S);

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

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

    if (viv) {
        ld ssa, ssb;
        ssa = ssb = 0;
        for (auto i : a) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssa += i;
        }
        for (auto i : b) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssb += i;
        }
        cout << ssa << ' ' << ssb << endl;
    }
}

int main() {
    freopen("ex.txt", "r", stdin);
    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

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;
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    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;
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-16;

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;
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    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;

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(b * b - 4 * c);
    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(20);
    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;
}


#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, i, j, cnt;
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;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    if (viv)
        cout << "Step " << cnt << endl, cnt++;

    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (b > 0 && viv) {
        cout << "Shit, their sum ";
        cout.precision(20);
        cout << b << endl;
//        exit(0);
    }

    if (viv && b * b - 4 * c < -eps) {
        cout.precision(20);
        cout << "Jopa " << fixed << b * b - 4 * c << endl;
        cout << "Jopa " << fixed << -eps * 100 << endl;
//        exit(0);
    }
    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 (abs(r2) < eps)
        r2 = 0;
    if (abs(r2 - s) < eps)
        r2 = s;
    if (viv && min(r1, r2) < -eps) {
        cout.precision(20);
        cout << "Hellll " << fixed << s << ' ' << r1 << ' ' << r2 << endl;
//        exit(0);
    }
    return {r1, r2};
}

void show(vector<ld> a, vector<ld> b) {
    cout << "So, is it: \n";
    vector<ld> lmx, lmn;
    lmx.resize(a.size());
    lmn.resize(a.size());
    cout.precision(8);
    for (ll i = 0; i < a.size(); i++)
        for (ll j = 0; j< b.size(); j++)
            lmn[min(i, j)] += a[i] * b[j], lmx[max(i, j)] += a[i] * b[j];
    for (auto i : lmx)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : lmn)
        cout << fixed << i << ' ';
    cout << endl;

    for (ll i = 0; i < n; i++) {
        lmx[i] -= mx[i];
        lmn[i] -= mn[i];
    }
    vector<ld> all;
    for (auto i : lmx)
        all.push_back(i);
    for (auto i : lmn)
        all.push_back(i);
    sort(all.begin(), all.end());

    cout << "Delta: ";
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[i] << ' ';
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[all.size() - 1 - 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];
        ld val = mx[i] + mn[i];
        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++) {
        pld val = root(suma[i], sumb[i], sum[i + 1], mx[i]);
        a.push_back(val.F);

        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
        if (a.back() < 0 || b.back() < 0 || sumb.back() > 1 || suma.back() > 1) {
            sumb.pop_back();
            suma.pop_back();
            b.pop_back();
            a.pop_back();
            a.push_back(val.S);

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

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

    if (viv) {
        ld ssa, ssb;
        ssa = ssb = 0;
        for (auto i : a) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssa += i;
        }
        for (auto i : b) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssb += i;
        }
        cout << ssa << ' ' << ssb << endl;
    }
}

int main() {
//    freopen("ex.txt", "r", stdin);
    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

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;

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;
const ld eps=1e-9;
const ld meps=1e-20;

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>

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-11;
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;

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;
const ld eps=1e-7;
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(x2)&&ins(sum[i]-x2))
  return x2;
return x1;
}

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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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);

swap(a, b);

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 = 1e-10;

ll n, i, j, cnt;
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;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    if (viv)
        cout << "Step " << cnt << endl, cnt++;

    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (b > 0 && viv) {
        cout << "Shit, their sum ";
        cout.precision(20);
        cout << b << endl;
//        exit(0);
    }

    if (viv && b * b - 4 * c < -eps) {
        cout.precision(20);
        cout << "Jopa " << fixed << b * b - 4 * c << endl;
        cout << "Jopa " << fixed << -eps * 100 << endl;
//        exit(0);
    }
    ld d = sqrt(max(b * b - 4 * c, (ld)0));
    ld r1 = (-b + d) / 2;
    ld r2 = (-b - d) / 2;
    if (r1 > r2)
        swap(r1, r2);
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    if (abs(r2) < eps)
        r2 = 0;
    if (abs(r2 - s) < eps)
        r2 = s;
    if (viv && min(r1, r2) < -eps) {
        cout.precision(20);
        cout << "Hellll " << fixed << s << ' ' << r1 << ' ' << r2 << endl;
//        exit(0);
    }
    return {r1, r2};
}

void show(vector<ld> a, vector<ld> b) {
    cout << "So, is it: \n";
    vector<ld> lmx, lmn;
    lmx.resize(a.size());
    lmn.resize(a.size());
    cout.precision(8);
    for (ll i = 0; i < a.size(); i++)
        for (ll j = 0; j< b.size(); j++)
            lmn[min(i, j)] += a[i] * b[j], lmx[max(i, j)] += a[i] * b[j];
    for (auto i : lmx)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : lmn)
        cout << fixed << i << ' ';
    cout << endl;

    for (ll i = 0; i < n; i++) {
        lmx[i] -= mx[i];
        lmn[i] -= mn[i];
    }
    vector<ld> all;
    for (auto i : lmx)
        all.push_back(i);
    for (auto i : lmn)
        all.push_back(i);
    sort(all.begin(), all.end());

    cout << "Delta: ";
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[i] << ' ';
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[all.size() - 1 - 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];
        ld val = mx[i] + mn[i];
        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++) {
        pld val = root(suma[i], sumb[i], sum[i + 1], mx[i]);
        a.push_back(val.F);

        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
        if (a.back() < 0 || b.back() < 0 || sumb.back() > 1 || suma.back() > 1) {
            sumb.pop_back();
            suma.pop_back();
            b.pop_back();
            a.pop_back();
            a.push_back(val.S);

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

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

    if (viv) {
        ld ssa, ssb;
        ssa = ssb = 0;
        for (auto i : a) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssa += i;
        }
        for (auto i : b) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssb += i;
        }
        cout << ssa << ' ' << ssb << endl;
    }
}

int main() {
//    freopen("ex.txt", "r", stdin);
    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

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-7;
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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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);

swap(a, b);

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

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, i, j, cnt;
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;
}

pld root(ld sa, ld sb, ld s, ld mx) {
    if (viv)
        cout << "Step " << cnt << endl, cnt++;

    ld b = sa - sb - s;
    ld c = - s * sa + mx;
    if (b > 0 && viv) {
        cout << "Shit, their sum ";
        cout.precision(20);
        cout << b << endl;
//        exit(0);
    }

    if (viv && b * b - 4 * c < -eps) {
        cout.precision(20);
        cout << "Jopa " << fixed << b * b - 4 * c << endl;
        cout << "Jopa " << fixed << -eps * 100 << endl;
//        exit(0);
    }
    ld d = sqrt(max(b * b - 4 * c, (ld)0));
    ld r1 = (-b + d) / 2;
    ld r2 = (-b - d) / 2;
    swap(r1, r2);
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    if (abs(r2) < eps)
        r2 = 0;
    if (abs(r2 - s) < eps)
        r2 = s;
    if (viv && min(r1, r2) < -eps) {
        cout.precision(20);
        cout << "Hellll " << fixed << s << ' ' << r1 << ' ' << r2 << endl;
//        exit(0);
    }
    return {r1, r2};
}

void show(vector<ld> a, vector<ld> b) {
    cout << "So, is it: \n";
    vector<ld> lmx, lmn;
    lmx.resize(a.size());
    lmn.resize(a.size());
    cout.precision(8);
    for (ll i = 0; i < a.size(); i++)
        for (ll j = 0; j< b.size(); j++)
            lmn[min(i, j)] += a[i] * b[j], lmx[max(i, j)] += a[i] * b[j];
    for (auto i : lmx)
        cout << fixed << i << ' ';
    cout << endl;
    for (auto i : lmn)
        cout << fixed << i << ' ';
    cout << endl;

    for (ll i = 0; i < n; i++) {
        lmx[i] -= mx[i];
        lmn[i] -= mn[i];
    }
    vector<ld> all;
    for (auto i : lmx)
        all.push_back(i);
    for (auto i : lmn)
        all.push_back(i);
    sort(all.begin(), all.end());

    cout << "Delta: ";
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[i] << ' ';
    for (ll i = 0; i < min(5ll, n); i++)
        cout << fixed << all[all.size() - 1 - 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];
        ld val = mx[i] + mn[i];
        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++) {
        pld val = root(suma[i], sumb[i], sum[i + 1], mx[i]);
        a.push_back(val.F);

        b.push_back(sum[i+1] - a.back());
        sumb.push_back(sumb.back() + b.back());
        suma.push_back(suma.back() + a.back());
        if (a.back() < 0 || b.back() < 0 || sumb.back() > 1 || suma.back() > 1) {
            sumb.pop_back();
            suma.pop_back();
            b.pop_back();
            a.pop_back();
            a.push_back(val.S);

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

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

    if (viv) {
        ld ssa, ssb;
        ssa = ssb = 0;
        for (auto i : a) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssa += i;
        }
        for (auto i : b) {
            if (i < 0)
                cout << "Warning " << i << endl;
            ssb += i;
        }
        cout << ssa << ' ' << ssb << endl;
    }
}

int main() {
//    freopen("ex.txt", "r", stdin);
    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

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) {
            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;

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-11;
const ld meps=1e-20;

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>

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=0;
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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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);

swap(a, b);

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 = 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};
    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-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, eps));
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;

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=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], (ld)0);
b[i]=max(b[i], (ld)0);
a[i]=min(a[i], (ld)1);
b[i]=min(b[i], (ld)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);

swap(a, b);

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 = stoi(s);
    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-13;

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;
    if (abs(r1) < eps)
        r1 = 0;
    if (abs(r1 - s) < eps)
        r1 = s;
    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

**/