#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 7;
const long long INF = 1e9 + 7;
const long double EPS = 1e-12;
const long long P = 485437;
const int C = 2016;
const int LOG = 63;
long double a[N], b[N], ma[N], mi[N];
int main() {
  cout << setprecision(15) << fixed;
  ios_base::sync_with_stdio(0);
  long double sum_a = 0, sum_b = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ma[i];
  for (int i = 0; i < n; i++) cin >> mi[i];
  for (int i = 0; i < n; i++) {
    long double x = ma[i] + mi[i];
    long double y = ma[i];
    long double b1 = sum_b - x - sum_a;
    long double c1 = y - x * sum_b;
    long double d = sqrt(max((long double)0, b1 * b1 - (long double)4.0 * c1));
    b[i] = (-b1 - d) / (long long)2.0, a[i] = x - b[i];
    if (abs(a[i] * ((long double)1.0 - sum_b - b[i]) +
            b[i] * ((long double)1.0 - sum_a - a[i]) + a[i] * b[i] - mi[i]) >
        EPS) {
      b[i] = (-b1 + d) / (long double)2.0, a[i] = x - b[i];
    }
    sum_a += a[i], sum_b += b[i];
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  cout << endl;
  return 0;
}
