#include <bits/stdc++.h>
using namespace std;
int n;
double mx[100005], mn[100005], a[100005], b[100005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &mx[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &mn[i]);
  for (int i = 1; i <= n; i++) mx[i] += mx[i - 1];
  for (int i = n; i; i--) mn[i] += mn[i + 1];
  for (int i = 1; i <= n; i++) {
    double xx = mx[i], yy = mn[i + 1];
    yy = -(yy - 1 - xx);
    double zz = sqrt(max(yy * yy - 4 * xx, 0.0));
    a[i] = (yy + zz) / 2;
    b[i] = yy - a[i];
  }
  for (int i = n; i; i--) a[i] -= a[i - 1], b[i] -= b[i - 1];
  for (int i = 1; i <= n; i++) printf("%.8lf ", a[i]);
  puts("");
  for (int i = 1; i <= n; i++) printf("%.8lf ", b[i]);
  puts("");
  return 0;
}
