#include <bits/stdc++.h>
using namespace std;
int mod1 = int(1e9) + 7;
double mmax[100100], mmin[100100];
double pa[100100], push_back[100100];
double suma[100100], sumb[100100];
double solve(double sa, double sb, double mi, double mx) {
  double x = mi + mx;
  double p = -x + sa - sb;
  double q = -x * sa + mi;
  double mph = -p / 2.0;
  double rst = 0;
  if (mph * mph > q) rst = sqrt(mph * mph - q);
  double x1 = mph + rst;
  double x2 = mph - rst;
  return x1;
}
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 1; i <= (int)(n); ++i) scanf("%lf", &mmax[i]);
  for (int i = 1; i <= (int)(n); ++i) scanf("%lf", &mmin[i]);
  for (int i = n; i >= 1; i--) {
    pa[i] = solve(suma[i + 1], sumb[i + 1], mmin[i], mmax[i]);
    push_back[i] = mmin[i] + mmax[i] - pa[i];
    suma[i] = suma[i + 1] + pa[i];
    sumb[i] = sumb[i + 1] + push_back[i];
  }
  for (int i = 1; i <= (int)(n); ++i) printf("%.8f ", pa[i]);
  printf("\n");
  for (int i = 1; i <= (int)(n); ++i) printf("%.8f ", push_back[i]);
  printf("\n");
  return 0;
}
