#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod) {
  x += y;
  if (x >= mod) x -= mod;
}
void et() {
  puts("-1");
  exit(0);
}
long double a[100005], b[100005], ma[100005], mi[100005];
bool gt(long double a, long double b) { return a - b > 1e-9; }
bool lt(long double a, long double b) { return b - a > 1e-9; }
bool le(long double a, long double b) { return abs(b - a) < 1e-9 || lt(a, b); }
void st(int k, long double ak, long double bk, long double ap, long double bp) {
  if (lt(ak, 0.0) || lt(bk, 0.0) || gt(ak, 1.0) || gt(bk, 1.0)) return;
  if (gt(ap + ak, 1.0) || gt(bp + bk, 1.0)) return;
  a[k] = ak;
  b[k] = bk;
}
void cal(int k, long double ap, long double bp) {
  assert(le(ap, 1));
  assert(le(bp, 1));
  long double g = ma[k] + mi[k];
  long double B = bp - ap - g;
  long double C = ma[k] - g * bp;
  long double det = (B * B - 4 * C);
  if (abs(det) < 1e-9)
    det = 0;
  else {
    assert(det > 0);
    det = sqrt(det);
  }
  long double ans1 = (-B - det) / 2, ans2 = (-B + det) / 2;
  long double ak1 = g - ans1, ak2 = g - ans2;
  st(k, ak1, ans1, ap, bp);
  st(k, ak2, ans2, ap, bp);
}
void fmain() {
  scanf("%d", &n);
  for (int(i) = 1; (i) <= (int)(n); (i)++) scanf("%Lf", ma + i);
  for (int(i) = 1; (i) <= (int)(n); (i)++) scanf("%Lf", mi + i);
  long double ap = 0, bp = 0;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    cal(i, ap, bp);
    ap += a[i];
    bp += b[i];
  }
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%.10Lf ", a[i]);
  puts("");
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%.10Lf ", b[i]);
  puts("");
}
int main() {
  fmain();
  return 0;
}
