#include <bits/stdc++.h>
using namespace std;
double min1[100005] = {0}, max1[100005] = {0};
double a[100005] = {0}, b[100005] = {0};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &max1[i]);
  for (int i = 0; i < n; i++) scanf("%lf", &min1[i]);
  double suma = 0.0;
  double sumb = 0.0;
  double sumc = 0.0;
  for (int i = 0; i < n - 1; i++) {
    double sum = max1[i] + min1[i];
    double b1 = sumb - suma + sum, c1 = sum * suma - max1[i];
    double root1 = (b1 - sqrt(max(b1 * b1 + 4.0 * c1, 0.0))) / (2.0);
    double root2 = (b1 + sqrt(max(b1 * b1 + 4.0 * c1, 0.0))) / (2.0);
    if (root1 < -1e-7 || (root1 - 1.0) > 1e-7) swap(root1, root2);
    sumc += max1[i];
    double chk1 = (sumb + root1) * (suma + sum - root1);
    double chk2 = (sumb + sum - root1) * (suma + root1);
    if (abs(chk1 - sumc) > 1e-7 && abs(chk2 - sumc) > 1e-7) swap(root1, root2);
    chk1 = (sumb + root1) * (suma + sum - root1);
    if (abs(chk1 - sumc) <= 1e-7) {
      a[i] = sum - root1;
      b[i] = root1;
    } else {
      a[i] = root1;
      b[i] = sum - root1;
    }
    sumb += b[i];
    suma += a[i];
  }
  b[n - 1] = 1 - sumb;
  a[n - 1] = 1 - suma;
  for (int i = 0; i < n; i++) printf("%.10lf ", abs(b[i]));
  printf("\n");
  for (int i = 0; i < n; i++) printf("%.10lf ", abs(a[i]));
  printf("\n");
  return 0;
}
