#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 1000 * 1000;
const long long inf64 = 1ll * inf * inf;
bool solve() {
  int n;
  scanf("%d", &n);
  vector<double> mx(n + 1), mn(n + 1), a(n + 1), b(n + 1);
  for (int i = 1; i <= n; i++) scanf("%lf", &mx[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &mn[i]);
  double s1, s2;
  s1 = s2 = 0.0;
  for (int i = 1; i <= n; i++) {
    double cur = mn[i] + mx[i];
    double P = s1 - s2 + cur;
    double Q = mx[i] - cur * s2;
    double D = P * P - 4 * Q;
    if (D < 0)
      D = 0.0;
    else
      D = sqrt(D);
    b[i] = (P - D) / 2.0;
    a[i] = cur - b[i];
    s1 += a[i];
    s2 += b[i];
  }
  for (int i = 1; i <= n; i++) printf("%.10lf ", a[i]);
  printf("\n");
  for (int i = 1; i <= n; i++) printf("%.10lf ", b[i]);
  printf("\n");
  return true;
}
int main() {
  solve();
  return 0;
}
