#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<double> ma, mi, a, b;
void rsh(int i, double b1, double a1, double c1, double b2, double a2,
         double c2) {
  double A = 1.000000000, B = b2 - a2 - c2 - c1, C = a2 * (c2 + c1) - c2;
  double D = max(B * B - 4.000000000 * C, double(0));
  b[i] = (-B + sqrt(D)) / (2.000000000);
  a[i] = c2 + c1 - b[i];
}
int main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  ma.resize(n);
  mi.resize(n);
  b.resize(n);
  a.resize(n);
  for (int i = 0; i < int(n); i++) cin >> ma[i];
  for (int i = 0; i < int(n); i++) cin >> mi[i];
  double k1 = 0, k2 = 0, k3 = 1, k4 = 1;
  for (int i = 0; i < int(n); i++) {
    rsh(i, k1, k2, ma[i], k3, k4, mi[i]);
    k1 += a[i];
    k2 += b[i];
    k3 -= a[i];
    k4 -= b[i];
  }
  cout.precision(30);
  for (int i = 0; i < int(n); i++) cout << a[i] << " ";
  cout << "\n";
  for (int j = 0; j < int(n); j++) cout << b[j] << " ";
  return 0;
}
