#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
int n;
double p[100010], q[100010], a[100010], b[100010];
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &p[i]);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%lf", &q[i]);
  }
  for (int i = 1; i <= n; ++i) p[i] += p[i - 1];
  for (int i = n; i >= 1; --i) q[i] += q[i + 1];
  a[n] = b[n] = 1.0;
  for (int i = 1; i < n; ++i) {
    double A = p[i] - q[i + 1] + 1;
    double B = p[i];
    double C = sqrt(fabs(A * A - 4 * B));
    a[i] = (A - C) / 2;
    b[i] = (A + C) / 2;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%.7lf ", a[i] - a[i - 1]);
  }
  printf("\n");
  for (int i = 1; i <= n; ++i) {
    printf("%.7lf ", b[i] - b[i - 1]);
  }
  printf("\n");
  return 0;
}
