#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 100;
double alpha[maxn], beta[maxn];
double a[maxn], b[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &beta[i]);
  for (int i = 0; i < n; i++) scanf("%lf", &alpha[i]);
  double Sa = 0, Sb = 0;
  for (int i = 0; i < n; i++) {
    double c = alpha[i] + beta[i];
    double A = 1, B = -(c + (Sb - Sa)), C = beta[i] - c * Sa;
    double x1 = (-B + sqrt(max(0., B * B - 4. * A * C))) / 2.;
    double y1 = c - x1;
    a[i] = x1;
    b[i] = y1;
    Sa += a[i];
    Sb += b[i];
  }
  cout.precision(15);
  for (int i = 0; i < n; i++) printf("%.9lf ", a[i]);
  printf("\n");
  for (int i = 0; i < n; i++) printf("%.9lf ", b[i]);
  printf("\n");
  return 0;
}
