#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MOD = 1e9 + 7;
const long double eps = 1e-12;
array<long double, 2> solve(long double sum, long double prod) {
  array<long double, 2> ret;
  if (abs(sum * sum - 4.0l * prod) < eps) return {0.5l * sum, 0.5l * sum};
  ret[0] = 0.5l * (sum + sqrtl(sum * sum - 4.0l * prod));
  ret[1] = 0.5l * (sum - sqrtl(sum * sum - 4.0l * prod));
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  long double a[n], b[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> b[i];
  long double prefX = 0, prefY = 0;
  long double X[n], Y[n];
  for (int i = 0; i < n; ++i) {
    long double prod = a[i] + prefX * prefY;
    long double sum = b[i] + a[i] + prefX + prefY;
    auto res = solve(sum, prod);
    X[i] = res[0] - prefX;
    Y[i] = res[1] - prefY;
    tie(prefX, prefY) = tie(res[0], res[1]);
  }
  for (int i = 0; i < n; ++i) cout << fixed << setprecision(15) << X[i] << ' ';
  cout << '\n';
  for (int i = 0; i < n; ++i) cout << fixed << setprecision(15) << Y[i] << ' ';
}
