#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int N = 100005;
const long long int inf = 1e12;
long double p[N], q[N], a[N], b[N];
long double solve(long double b, long double c) {
  long double val = (-b - sqrt(abs(b * b - 4 * c))) / 2;
  if (val >= 0 && val <= 1) return val;
  val = (-b + sqrt(abs(b * b - 4 * c))) / 2;
  return val;
}
signed main() {
  long long int n;
  cin >> n;
  cout << setprecision(10) << fixed;
  for (long long int i = 1; i <= n; i++) cin >> p[i];
  for (long long int i = 1; i <= n; i++) cin >> q[i];
  long double x = 0, y = 0;
  for (long long int i = 1; i <= n; i++) {
    long double s = p[i] + q[i];
    a[i] = solve(y - x - s, p[i] - s * y);
    b[i] = s - a[i];
    cout << a[i] << " ";
    x += b[i], y += a[i];
  }
  cout << endl;
  for (long long int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
