#include <bits/stdc++.h>
using namespace std;
class C_ {};
template <typename T>
C_& operator<<(C_& __m, const T& __s) {
  if (!1) cerr << "\E[91m" << __s << "\E[0m";
  return __m;
}
C_ merr;
struct __s {
  __s() {
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    merr << "Execution time: " << fixed << setprecision(3)
         << (double)clock() / CLOCKS_PER_SEC << " s.\n";
  }
} __S;
double mx[111111];
double mn[111111];
double AA[111111];
double BB[111111];
int main(void) {
  int n;
  srand((int)time(0));
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mx[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> mn[i];
  }
  double c1 = 0.0, c2 = 0.0;
  for (int i = 0; i < n; i++) {
    double c3 = c1 - c2;
    double c4 = mx[i] - c2 * (mx[i] + mn[i]);
    double A = 1.0, B = -c3 - mx[i] - mn[i], C = c4;
    double D = B * B - 4.0 * A * C;
    assert(D >= 0.0 || fabs(D < 1e-9));
    if (fabs(D < 1e-9)) D = 0.0;
    double a1 = (-B + sqrt(D)) / (2.0 * A);
    double a2 = (-B - sqrt(D)) / (2.0 * A);
    double b1 = (mx[i] + mn[i] - a1);
    double b2 = (mx[i] + mn[i] - a2);
    double a, b;
    if (a1 < 0.0 || b1 < 0.0 || a1 > 1.0 || b1 > 1.0) {
      a = a2, b = b2;
    } else if (a2 < 0.0 || b2 < 0.0 || a2 > 1.0 || b2 > 1.0) {
      a = a1, b = b1;
    } else if (fabs(a1 - b1) < fabs(a2 - b2)) {
      a = a1, b = b1;
    } else {
      a = a2, b = b2;
    }
    c1 += b;
    c2 += a;
    AA[i] = a;
    BB[i] = b;
  }
  for (int i = 0; i < n; i++) {
    cout << fixed << setprecision(10) << AA[i] << " ";
  }
  cout << '\n';
  for (int i = 0; i < n; i++) {
    cout << fixed << setprecision(10) << BB[i] << " ";
  }
  cout << '\n';
  return 0;
}
