#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000 + 7;
double a[MAXN], b[MAXN];
double suma[MAXN], sumb[MAXN];
double sum[MAXN];
double ansa[MAXN], ansb[MAXN];
double psa[MAXN], psb[MAXN];
double solve(double a, double b, double c) {
  double d = b * b - 4 * a * c;
  double a1 = (-b + sqrt(max(0.0, d))) / (2 * a);
  double a2 = (-b - sqrt(max(0.0, d))) / (2 * a);
  return max(a1, a2);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    suma[i] = suma[i - 1] + a[i];
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &b[i]);
  }
  for (int i = n; i >= 1; i--) {
    sumb[i] = sumb[i + 1] + b[i];
  }
  for (int i = 1; i < n; i++) {
    sum[i] = 1 + suma[i] - sumb[i + 1];
  }
  for (int i = 1; i < n; i++) {
    double cursum = sum[i] - sum[i - 1];
    ansa[i] =
        solve(-1, cursum + psb[i - 1] - psa[i - 1], cursum * psa[i - 1] - a[i]);
    ansb[i] = cursum - ansa[i];
    psa[i] = psa[i - 1] + ansa[i];
    psb[i] = psb[i - 1] + ansb[i];
  }
  ansa[n] = 1 - psa[n - 1];
  ansb[n] = 1 - psb[n - 1];
  for (int i = 1; i <= n; i++) {
    printf("%.10lf ", ansa[i]);
  }
  printf("\n");
  for (int i = 1; i <= n; i++) {
    printf("%.10lf ", ansb[i]);
  }
  return 0;
}
