#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:667772160")
using namespace std;
struct __isoff {
  __isoff() {
    if (0) freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
    srand('C' + 'T' + 'A' + 'C' + 'Y' + 'M' + 'B' + 'A');
    srand(time(0));
  }
  ~__isoff() {}
} __osafwf;
const unsigned long long p1 = 123123;
const unsigned long long p2 = 12321;
const double eps = 1e-6;
const double pi = acos(-1.0);
const long long inf = 1e18 + 7;
const int infi = 2e9 + 7;
const long long dd = 1e6 + 7;
const long long sh = 4501;
const long long mod = 1e9 + 7;
const long long mod2 = 100003;
double msqrt(double t) { return sqrt(max(t, 0.0)); }
int main() {
  int n;
  cin >> n;
  vector<double> A(n), B(n);
  vector<double> S(n), P(n);
  for (long long i = 0; i < (long long)n; i++) {
    cin >> A[i];
  }
  for (long long i = 0; i < (long long)n; i++) {
    cin >> B[i];
  }
  double Aa, Bb;
  Aa = Bb = 0;
  for (long long i = 0; i < (long long)n; i++) {
    double x, y;
    double a = Aa, b = Bb, c1 = A[i], c2 = B[i];
    x = 0.5 * (-msqrt((a - b + c1 + c2) * (a - b + c1 + c2) +
                      4 * (b * c1 + b * c2 - c1)) +
               a - b + c1 + c2);
    y = 0.5 * (msqrt((a - b + c1 + c2) * (a - b + c1 + c2) +
                     4 * (b * c1 + b * c2 - c1)) -
               a + b + c1 + c2);
    S[i] = x;
    P[i] = y;
    Aa += P[i];
    Bb += S[i];
  }
  for (long long i = 0; i < (long long)n; i++) {
    printf("%0.10f ", S[i]);
  }
  cout << "\n";
  for (long long i = 0; i < (long long)n; i++) {
    printf("%0.10f ", P[i]);
  }
}
