#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const long long int INF = 123456789987654321;
FILE *fin, *fout;
int N;
vector<double> mx, mn;
vector<double> px, pn;
vector<double> S;
vector<double> P, Q;
int main() {
  scanf("%d", &N);
  mx.resize(N);
  px.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%lf", &mx[i]);
    px[i] = mx[i];
    if (i != 0) px[i] += px[i - 1];
  }
  mn.resize(N);
  pn.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%lf", &mn[i]);
    pn[i] = mn[i];
    if (i != 0) pn[i] += pn[i - 1];
  }
  S.resize(N);
  for (int i = 0; i < N; i++) {
    S[i] = px[i] + pn[i];
  }
  P.resize(N);
  Q.resize(N);
  for (int i = 0; i < N; i++) {
    P[i] = (S[i] + sqrt(abs(S[i] * S[i] - 4 * px[i]))) / 2;
    Q[i] = (S[i] - sqrt(abs(S[i] * S[i] - 4 * px[i]))) / 2;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (i != 0) P[i] -= P[i - 1];
    if (i != 0) Q[i] -= Q[i - 1];
  }
  for (int i = 0; i < N; i++) {
    printf("%.10lf ", abs(P[i]));
  }
  printf("\n");
  for (int i = 0; i < N; i++) {
    printf("%.10lf ", abs(Q[i]));
  }
}
