#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int MAXN = 1000100;
int q = 0, qq, n;
double x[MAXN], y[MAXN];
double c1[MAXN];
double c2[MAXN];
double c[MAXN];
void solve() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> c1[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> c2[i];
    c[i] = c2[i] + c1[i];
  }
  double s1 = 0, s2 = 0;
  for (int i = 0; i < n; ++i) {
    double b = (c[i] + s2 - s1);
    double x1 =
        -(-b + sqrt(max(0.0, ((b) * (b)) + 4 * (c[i] * s1 - c1[i])))) / 2;
    double x2 =
        -(-b - sqrt(max(0.0, ((b) * (b)) + 4 * (c[i] * s1 - c1[i])))) / 2;
    x[i] = max(x1, x2);
    y[i] = c[i] - x[i];
    s1 += x[i];
    s2 += y[i];
  }
  cout.precision(10);
  for (int i = 0; i < n; ++i) cout << fixed << x[i] << ' ';
  cout << endl;
  for (int i = 0; i < n; ++i) cout << fixed << y[i] << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(1313);
  solve();
  return 0;
}
