#include <bits/stdc++.h>
using namespace std;
void smain();
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(7);
  cout << fixed;
  smain();
  return 0;
}
long long n, m;
long double mx[500002], mn[500002];
long double a[500002], b[500002];
void smain() {
  for (; cin >> n;) {
    for (long long i = 0; i < n; i++) cin >> mx[i];
    for (long long i = 0; i < n; i++) cin >> mn[i];
    long double sa = 0, sb = 0;
    for (long long i = 0; i < n - 1; i++) {
      long double c = mx[i] + mn[i];
      long double B = c + sb - sa;
      long double C = c * sa - mx[i];
      long double D = B * B + 4 * C;
      if (D < 0) D = 0;
      long double x1 = (-B - sqrt(D)) / -2;
      if (fabs(x1) < 1E-9) x1 = 0;
      long double x2 = c - x1;
      if (x1 < 0 || x2 < 0) {
        x1 = (-B + sqrt(D)) / -2;
        if (fabs(x1) < 1E-9) x1 = 0;
        x2 = c - x2;
      }
      a[i] = x1, b[i] = x2;
      sa += x1, sb += x2;
    }
    a[n - 1] = 1 - sa;
    b[n - 1] = 1 - sb;
    for (long long i = 0; i < n; i++) cout << a[i] << ' ';
    cout << endl;
    for (long long i = 0; i < n; i++) cout << b[i] << ' ';
    cout << endl;
  }
}
