#include <bits/stdc++.h>
using namespace std;
double pmax[200001], pmin[200001], sb[200001], sa[200001];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", pmax + i), pmax[i] += pmax[i - 1];
  for (int i = 1; i <= n; i++) scanf("%lf", pmin + i);
  for (int i = n - 1; i; i--) pmin[i] += pmin[i + 1];
  for (int i = 1; i <= n; i++) {
    double a = 1, b = pmin[i + 1] - pmax[i] - 1, c = pmax[i],
           dt = sqrt(abs(b * b - 4 * a * c));
    sa[i] = (dt - b) / (2 * a);
    sb[i] = (-dt - b) / (2 * a);
  }
  for (int i = 1; i <= n; i++) printf("%.8g ", sa[i] - sa[i - 1]);
  puts("");
  for (int i = 1; i <= n; i++) printf("%.8g ", sb[i] - sb[i - 1]);
  puts("");
}
