#include <bits/stdc++.h>
using namespace std;
long long mod = 100000007LL;
int main() {
  int n;
  cin >> n;
  vector<double> ma;
  vector<double> mi;
  for (int i = 0; i < n; i++) {
    double x;
    scanf("%lf", &x);
    ma.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    double x;
    scanf("%lf", &x);
    mi.push_back(x);
  }
  for (int i = 1; i < n; i++) {
    ma[i] += ma[i - 1];
  }
  for (int i = n - 2; i >= 0; i--) {
    mi[i] += mi[i + 1];
  }
  vector<double> sa, sb;
  sa.assign(n + 1, 0.0);
  sb.assign(n + 1, 0.0);
  sa[n] = 1.0;
  sb[n] = 1.0;
  for (int i = 0; i < n - 1; i++) {
    double a = ma[i];
    double b = mi[i + 1];
    b = 1.0 + a - b;
    sa[i + 1] = (b - sqrt(max(b * b - 4 * a, 0.0))) / 2.0;
    sb[i + 1] = (b + sqrt(max(b * b - 4 * a, 0.0))) / 2.0;
  }
  for (int i = 1; i <= n; i++) {
    printf("%.15lf ", sa[i] - sa[i - 1]);
  }
  cout << endl;
  for (int i = 1; i <= n; i++) {
    printf("%.15lf ", sb[i] - sb[i - 1]);
  }
  return 0;
}
