#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 7;
const int MAXN = (int)1e5 + 7;
int n;
long double mx[MAXN];
long double mn[MAXN];
long double a[MAXN];
long double b[MAXN];
long double tmx[MAXN];
long double tmn[MAXN];
inline long double solve(long double a, long double b, long double c) {
  long double d = b * b - 4 * a * c;
  if (d == 0) return -(b / (2 * a));
  d = fabs(d);
  return max((-b + sqrt(d)) / (2 * a), (-b - sqrt(d)) / (2 * a));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    double x;
    scanf("%lf", &x);
    mx[i] = x;
    mx[i] += mx[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    double x;
    scanf("%lf", &x);
    mn[i] = x;
  }
  for (int i = n; i > 0; i--) mn[i] += mn[i + 1];
  for (int i = 1; i <= n; i++) mn[i] -= 1;
  a[n] = 1;
  b[n] = 1;
  for (int i = 1; i < n; i++) {
    long double x;
    x = solve(1, mn[i + 1] - mx[i], mx[i]);
    a[i] = x;
    b[i] = mx[i] / a[i];
  }
  for (int i = 1; i <= n; i++) {
    printf("%.7f ", (double)(a[i] - a[i - 1]));
  }
  printf("\n");
  for (int i = 1; i <= n; i++) {
    printf("%.7f ", (double)(b[i] - b[i - 1]));
  }
  return 0;
}
