#include <bits/stdc++.h>
using namespace std;
int n;
double a[100010], b[100010], x1[100010], x2[100010];
int main() {
  scanf("%d", &n);
  b[0] = 0;
  b[n + 1] = 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &b[i]);
    b[i] = b[i - 1] + b[i];
  }
  a[n + 1] = 0;
  a[0] = 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &a[i]);
  }
  for (int i = n; i >= 1; --i) a[i] += a[i + 1];
  for (int i = 1; i <= n; ++i) {
    double B = 1 + b[i] - a[i + 1], C = b[i];
    double del = sqrt(abs(B * B - 4 * C));
    x1[i] = (B + del) / 2, x2[i] = (B - del) / 2;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%.10lf ", x1[i] - x1[i - 1]);
  }
  printf("\n");
  for (int i = 1; i <= n; ++i) {
    printf("%.10lf ", x2[i] - x2[i - 1]);
  }
}
