#include <bits/stdc++.h>
using namespace std;
double a[100100], b[100100];
double ans[2][100100];
double m_sqrt(double x) {
  double l = 0, r = 10;
  for (int i = 0; i < 50; i++) {
    double m = (l + r) / 2;
    if (m * m <= x) {
      l = m;
    } else {
      r = m;
    }
  }
  return l;
}
void Solve() {
  int i, j, k, n, m;
  scanf("%d", &(n));
  for (i = 0; i < n; i++) scanf("%lf", &a[i]);
  for (i = 0; i < n; i++) scanf("%lf", &b[i]);
  double x = 0.0, y = 0.0;
  for (i = 0; i < n; i++) {
    double bb = y - x - a[i] - b[i];
    double D = bb * bb + 4.0 * (a[i] * y + b[i] * y - a[i]);
    double d = m_sqrt(D);
    double p = (-bb + d) / 2.0;
    ans[1][i] = max(p, 0.0);
    ans[0][i] = max(a[i] + b[i] - p, 0.0);
    x += ans[0][i];
    y += ans[1][i];
  }
  for (i = 0; i < n; i++) printf("%.10lf ", ans[0][i]);
  printf("\n");
  for (i = 0; i < n; i++) printf("%.10lf ", ans[1][i]);
}
int main() {
  Solve();
  return 0;
}
