#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int n;
long double maxv[maxn], minv[maxn], p1[maxn], p2[maxn];
void read(long double& x) {
  double t;
  scanf("%lf", &t);
  x = t;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    read(maxv[i]);
  }
  for (int i = 1; i <= n; i++) {
    read(minv[i]);
  }
  long double sum1 = (long double)0;
  long double sum2 = (long double)0;
  for (int i = 1; i <= n - 1; i++) {
    long double a = (long double)1;
    long double b = -(maxv[i] + minv[i] + sum2 - sum1);
    long double c = maxv[i] - (minv[i] + maxv[i]) * sum1;
    long double delta = b * b - 4 * a * c;
    if (fabs(delta) < 1e-9) {
      p1[i] = (-b) / (2 * a);
    } else {
      if ((-b - delta) / (2 * a) > 1e-9) {
        p1[i] = (-b - sqrt(delta)) / (2 * a);
      } else {
        p1[i] = (-b + sqrt(delta)) / (2 * a);
      }
    }
    p2[i] = minv[i] + maxv[i] - p1[i];
    sum1 += p1[i];
    sum2 += p2[i];
  }
  p1[n] = 1 - sum1;
  p2[n] = 1 - sum2;
  for (int i = 1; i <= n; i++) {
    printf("%.9lf ", (double)p1[i]);
  }
  printf("\n");
  for (int i = 1; i <= n; i++) {
    printf("%.9lf ", (double)p2[i]);
  }
  printf("\n");
  return 0;
}
