#include <bits/stdc++.h>
int main() {
  unsigned i, dim;
  scanf("%u", &dim);
  double max[dim], min[dim], p1[dim], p2[dim], sum, sum_p1 = 0.0, sum_p2 = 0.0,
                                                    D, b, root1, root2;
  for (i = 0; i < dim; i++) scanf("%lf", &max[i]);
  for (i = 0; i < dim; i++) scanf("%lf", &min[i]);
  for (i = 0; i < dim; i++) {
    sum = max[i] + min[i];
    b = sum_p1 - sum_p2 - sum;
    D = fabs(b * b - 4 * (max[i] - sum * sum_p1));
    root1 = (-b + sqrt(D)) / 2;
    root2 = (-b - sqrt(D)) / 2;
    p1[i] = root1 >= root2 ? root1 : root2;
    p2[i] = sum - p1[i];
    sum_p1 += p1[i];
    sum_p2 += p2[i];
  }
  for (i = 0; i < dim; i++)
    printf("%.16lf%c", p1[i], (i < dim - 1) ? ' ' : '\n');
  for (i = 0; i < dim; i++)
    printf("%.16lf%c", p2[i], (i < dim - 1) ? ' ' : '\n');
  return 0;
}
