#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline void upmin(T &t, T tmp) {
  if (t > tmp) t = tmp;
}
template <class T>
inline void upmax(T &t, T tmp) {
  if (t < tmp) t = tmp;
}
inline int sgn(double x) {
  if (abs(x) < 1e-9) return 0;
  return (x > 0) ? 1 : -1;
}
const double Pi = acos(-1.0);
int gint() {
  int res = 0;
  bool neg = 0;
  char z;
  for (z = getchar(); z != EOF && z != '-' && !isdigit(z); z = getchar())
    ;
  if (z == EOF) return 0;
  if (z == '-') {
    neg = 1;
    z = getchar();
  }
  for (; z != EOF && isdigit(z); res = res * 10 + z - '0', z = getchar())
    ;
  return (neg) ? -res : res;
}
long long gll() {
  long long res = 0;
  bool neg = 0;
  char z;
  for (z = getchar(); z != EOF && z != '-' && !isdigit(z); z = getchar())
    ;
  if (z == EOF) return 0;
  if (z == '-') {
    neg = 1;
    z = getchar();
  }
  for (; z != EOF && isdigit(z); res = res * 10 + z - '0', z = getchar())
    ;
  return (neg) ? -res : res;
}
const int maxn = 110000;
int n;
double pmax[maxn], pmin[maxn];
double prea[maxn], preb[maxn], suca[maxn], sucb[maxn], a[maxn], b[maxn];
void calc(double &x, double &y, double a, double b, double c, double d,
          double e, double f) {
  double A = b + e, B = a * e - b * d - c - f, C = c * d - a * f;
  y = sgn(B * B - 4.0 * A * C) == 0
          ? (-B) / (2.0 * A)
          : (-B + sqrt(B * B - 4.0 * A * C)) / (2.0 * A);
  x = (c + f - (b + e) * y) / (a + d);
}
int main() {
  int i;
  n = gint();
  for (i = (1); i <= (n); i++) scanf("%lf\n", &pmax[i]);
  for (i = (1); i <= (n); i++) scanf("%lf\n", &pmin[i]);
  prea[0] = preb[0] = 0.0;
  suca[1] = sucb[1] = 1.0;
  for (i = (1); i <= (n); i++) {
    calc(a[i], b[i], preb[i - 1], prea[i - 1], pmax[i], sucb[i], suca[i],
         pmin[i]);
    prea[i] = prea[i - 1] + a[i];
    preb[i] = preb[i - 1] + b[i];
    suca[i + 1] = suca[i] - a[i];
    sucb[i + 1] = sucb[i] - b[i];
  }
  for (i = (1); i <= (n); i++) printf("%0.10lf ", a[i]);
  printf("\n");
  for (i = (1); i <= (n); i++) printf("%0.10lf ", b[i]);
  ;
  printf("\n");
  return 0;
}
