#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-all-loops")
#pragma GCC target("avx2")
using namespace std;
ifstream in;
ofstream out;
const long long kk = 1000;
const long long ml = kk * kk;
const long long mod = ml * kk + 7;
const long long inf = ml * ml * ml + 7;
const long double eps = 1e-7;
long long n, con;
vector<long double> mx, mn, sum;
bool viv = false;
long double read() {
  string s;
  cin >> s;
  if (s.size() == 1 || s[0] == '1') return s[0] - '0';
  s.erase(s.begin());
  s.erase(s.begin());
  s.resize(9, '0');
  long double ans = atoi(s.c_str());
  ans /= 1e9;
  return ans;
}
pair<long double, long double> root(long double sa, long double sab,
                                    long double s, long double mx) {
  long double b = 2 * sa - sab - s;
  long double c = mx - s * sa;
  cout.precision(20);
  long double d = sqrtl(max((long double)0, b * b - 4 * c));
  pair<long double, long double> rs = {(-b + d) / 2, 0};
  rs.second = -b - rs.first;
  if (abs(rs.first) < eps) rs.first = 0;
  if (abs(rs.second) < eps) rs.second = 0;
  if (abs(rs.first - s) < eps) rs.first = s;
  if (abs(rs.second - s) < eps) rs.second = s;
  return rs;
}
void prepare() {
  sum = mn;
  for (long long i = 0; i < n; i++) sum[i] += mx[i];
  vector<long double> pref;
  pref.push_back(0);
  for (long long i = 0; i < n; i++) pref.push_back(pref.back() + sum[i]);
  long double suma = 0;
  vector<long double> a, b;
  for (long long i = 0; i < n; i++) {
    pair<long double, long double> add = root(suma, pref[i], sum[i], mx[i]);
    if (viv) cout << "__ " << add.first << ' ' << add.second << endl;
    a.push_back(add.first);
    suma += a.back();
    if (a.back() < 0 || sum[i] - a.back() < 0) {
      suma -= a.back();
      a.pop_back();
      a.push_back(add.second);
      suma += a.back();
    }
    if (a.back() < 0 || sum[i] - a.back() < 0) {
      suma -= a.back();
      a.pop_back();
      a.push_back(0);
      suma += a.back();
    }
  }
  cout.precision(6);
  for (long long i = 0; i < n; i++) cout << fixed << a[i] << ' ';
  cout << endl;
  for (long long i = 0; i < n; i++) cout << fixed << sum[i] - a[i] << ' ';
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) mx.push_back(read());
  for (long long i = 0; i < n; i++) mn.push_back(read());
  prepare();
  return 0;
}
