#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
template <typename T>
T sqr(const T &x) {
  return x * x;
}
template <typename T>
T my_abs(const T &x) {
  return x < 0 ? -x : x;
}
const int INF = (int)1e9;
const long long LINF = (long long)6e18;
const long long INF64 = LINF;
const long long INFLL = LINF;
const long double EPS = 1e-8;
const long double PI = 3.1415926535897932384626433832795;
const long double ME = 1e-5;
const long long MOD = (int)1e9 + 7;
const long long MOD2 = (int)1e9 + 21;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
const int N = (int)1e5 + 10;
int n;
long double pmin[N];
long double pmax[N];
long double p[2][N];
long double psum[2][N];
inline void solve() {
  scanf("%d", &n);
  for (int i = 0; i < int(n); ++i) {
    double cur;
    scanf("%lf", &cur);
    pmax[i] = cur;
  }
  for (int i = 0; i < int(n); ++i) {
    double cur;
    scanf("%lf", &cur);
    pmin[i] = cur;
  }
  for (int i = 0; i < int(n); ++i) {
    long double c1 = psum[0][i];
    long double c2 = psum[1][i];
    long double a = 1;
    long double b = -(pmax[i] + pmin[i] - c1 + c2);
    long double c = -c1 * (pmax[i] + pmin[i]) + pmax[i];
    long double d = sqr(b) - 4.0 * a * c;
    if (d < 0) d = 0;
    long double x = (-b + sqrt(d)) / 2.0;
    if (x < -EPS || x > 1 + EPS) {
      x = (-b - sqrt(d)) / 2.0;
    }
    p[0][i] = x;
    p[1][i] = pmax[i] + pmin[i] - x;
    for (int j = 0; j < int(2); ++j) {
      psum[j][i + 1] = psum[j][i] + p[j][i];
    }
  }
  for (int j = 0; j < int(2); ++j) {
    for (int i = 0; i < int(n); ++i) {
      double cur = p[j][i];
      printf("%.10lf ", cur);
    }
    printf("\n");
  }
}
int main() {
  srand((unsigned int)time(NULL));
  cout << setprecision(15) << fixed;
  solve();
  cerr << clock() << endl;
  return 0;
}
