#include <bits/stdc++.h>
using namespace std;
int n;
double a[100005], b[100005];
double res1[100005], res2[100005];
double s1, s2;
void did(double he, double ji) {
  double tmp = he * he - 4 * ji;
  if (tmp < 0) tmp = 0;
  double one = he / 2.0 + sqrt(tmp) / 2.0;
  double two = he - one;
  if (s1 > s2) {
    s1 = one;
    s2 = two;
  } else {
    s1 = two;
    s2 = one;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &b[i]);
  for (int i = 1; i <= n; i++) {
    double he = b[i] - (1 - s1) * (1 - s2) + 1 + a[i] + s1 * s2;
    double ji = a[i] + s1 * s2;
    double t1 = s1, t2 = s2;
    did(he, ji);
    res1[i] = s1 - t1;
    res2[i] = s2 - t2;
  }
  for (int i = 1; i <= n; i++) {
    printf("%.7lf ", res1[i]);
  }
  puts("");
  for (int i = 1; i <= n; i++) {
    printf("%.7lf ", res2[i]);
  }
  puts("");
  return 0;
}
