#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000001;
int main() {
  int n;
  long double t, k, ku, sma, smi;
  vector<vector<long double>> p(100010, vector<long double>(2)),
      a(100010, vector<long double>(2));
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> p[i][0];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> p[i][1];
  }
  sma = smi = 0;
  for (int i = n; i >= 2; --i) {
    t = p[i][1] + p[i][0];
    k = p[i][1] - smi * t;
    t += sma - smi;
    ku = sqrt(t * t - 4 * k);
    a[i][0] = (t + ku) / 2.0 - sma + smi;
    a[i][1] = (t - ku) / 2.0;
    sma += a[i][0];
    smi += a[i][1];
  }
  a[1][0] = 1 - sma;
  a[1][1] = 1 - smi;
  for (int i = 1; i <= n; ++i) cout << setprecision(20) << a[i][0] << ' ';
  cout << endl;
  for (int i = 1; i <= n; ++i) cout << setprecision(20) << a[i][1] << ' ';
  cout << endl;
  return 0;
}
