#include <bits/stdc++.h>
using namespace std;
using ld = long double;
const int maxn = 1e5 + 10;
ld min_p[maxn], max_p[maxn], min_f[maxn], max_f[maxn], pf[maxn], qf[maxn];
pair<ld, ld> p_q(ld sum, ld pr) {
  ld diff = sum * sum - 4 * pr;
  diff = sqrt(diff);
  return {(sum + diff) / 2, (sum - diff) / 2};
}
pair<ld, ld> p_q_ex(ld a, ld b) { return p_q(b - a + 1, b); }
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(15);
  cout << fixed;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> max_p[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> min_p[i];
  }
  min_f[n - 1] = min_p[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    min_f[i] = min_f[i + 1] + min_p[i];
  }
  max_f[0] = max_p[0];
  for (int i = 1; i < n; ++i) {
    max_f[i] = max_f[i - 1] + max_p[i];
  }
  for (int i = 1; i < n; ++i) {
    auto l = p_q_ex(min_f[i], max_f[i - 1]);
    pf[i - 1] = l.first;
    qf[i - 1] = l.second;
  }
  pf[n - 1] = qf[n - 1] = 1;
  cout << pf[0] << " ";
  for (int i = 1; i < n; ++i) {
    cout << pf[i] - pf[i - 1] << " ";
  }
  cout << "\n";
  cout << qf[0] << " ";
  for (int i = 1; i < n; ++i) {
    cout << qf[i] - qf[i - 1] << " ";
  }
  cout << "\n";
}
