#include <bits/stdc++.h>
#pragma GCC optimize("O0")
using namespace std;
const int maxn = 1e5 + 10;
int N;
double v[maxn], w[maxn];
double S1[maxn], S2[maxn];
double vv[maxn], ww[maxn];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%lf", &v[i]);
  for (int i = 1; i <= N; ++i) scanf("%lf", &w[i]);
  S1[1] =
      ((w[1] + v[1]) + sqrt((w[1] + v[1]) * (w[1] + v[1]) - 4.0 * v[1])) / 2;
  S2[1] =
      ((w[1] + v[1]) - sqrt((w[1] + v[1]) * (w[1] + v[1]) - 4.0 * v[1])) / 2;
  for (int i = 2; i <= N; ++i) {
    vv[i] = v[i] + S1[i - 1] * S2[i - 1];
    ww[i] = w[i] + S1[i - 1] + S2[i - 1] - S1[i - 1] * S2[i - 1];
    S1[i] = ((ww[i] + vv[i]) +
             sqrt((ww[i] + vv[i]) * (ww[i] + vv[i]) - 4.0 * vv[i])) /
            2;
    S2[i] = ((ww[i] + vv[i]) -
             sqrt((ww[i] + vv[i]) * (ww[i] + vv[i]) - 4.0 * vv[i])) /
            2;
  }
  for (int i = 1; i <= N; ++i) {
    printf("%lf ", S1[i] - S1[i - 1]);
  }
  printf("\n");
  for (int i = 1; i <= N; ++i) {
    printf("%lf ", S2[i] - S2[i - 1]);
  }
  printf("\n");
}
