#include <bits/stdc++.h>
const double eps = 1e-8;
bool check(double solution, double current_sum, double current_sum_other,
           double sum) {
  return -eps <= solution && solution <= 1 + eps &&
         current_sum + solution <= 1 + eps && -eps <= (sum - solution) &&
         (sum - solution) <= 1 + eps &&
         (current_sum_other + sum - solution) <= 1 + eps;
}
int main() {
  int n;
  scanf("%d", &n);
  std::vector<double> maxs(n), mins(n);
  std::vector<double> as(n), bs(n);
  std::vector<double> a_sums(n), b_sums(n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf", &maxs[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%lf", &mins[i]);
  }
  for (int i = 0; i < n; ++i) {
    double sum = maxs[i] + mins[i];
    double prev_sum_a = (i > 0 ? a_sums[i - 1] : 0);
    double prev_sum_b = (i > 0 ? b_sums[i - 1] : 0);
    double c1 = (prev_sum_b - prev_sum_a - sum);
    double c0 = maxs[i] - prev_sum_b * sum;
    double solution1 = (-c1 - std::sqrt(std::max(c1 * c1 - 4 * c0, 0.0))) / 2;
    if (true) {
      as[i] = sum - solution1;
      bs[i] = solution1;
    } else {
      double solution2 = (-c1 + std::sqrt(std::max(c1 * c1 - 4 * c0, 0.0))) / 2;
      as[i] = sum - solution2;
      bs[i] = solution2;
    }
    a_sums[i] = prev_sum_a + as[i];
    b_sums[i] = prev_sum_b + bs[i];
  }
  for (int i = 0; i < n; ++i) {
    printf("%.10f ", as[i]);
  }
  printf("\n");
  for (int i = 0; i < n; ++i) {
    printf("%.10f ", bs[i]);
  }
  printf("\n");
  return 0;
}
