#include <bits/stdc++.h>
using namespace std;
int N;
double mx[110000], mn[110000];
double p[110000], q[110000];
double calc(double s, double a, double b, double c) {
  double A = 1, B = b - s - a, C = c - s * b;
  double x1 = (-B + sqrt(max(B * B - 4 * A * C, 0.0))) / (2 * A);
  double x2 = (-B - sqrt(max(B * B - 4 * A * C, 0.0))) / (2 * A);
  if (x1 > -1e-8 && x1 + b < 1 + 1e-8)
    return max(x1, 0.0);
  else
    return max(x2, 0.0);
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%lf", &mx[i]);
  for (int i = 0; i < N; i++) scanf("%lf", &mn[i]);
  double sp = 0, sq = 0;
  for (int i = 0; i < N; i++) {
    p[i] = calc(mx[i] + mn[i], sq, sp, mx[i]);
    q[i] = mx[i] + mn[i] - p[i];
    sp += p[i];
    sq += q[i];
  }
  for (int i = 0; i < N; i++) printf("%.10lf ", p[i]);
  puts("");
  for (int i = 0; i < N; i++) printf("%.10lf ", q[i]);
  puts("");
  return 0;
}
