#include <bits/stdc++.h>
using namespace std;
double mx[100005], mn[100005], ans1[100005], ans2[100005];
void calc(double a, double b, double c, double &x, double &y) {
  x = (-b - sqrt(fabs(b * b - 4 * a * c))) / (2 * a);
  y = (-b + sqrt(fabs(b * b - 4 * a * c))) / (2 * a);
  if (x > y) swap(x, y);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &mx[i]);
  for (int i = 1; i <= n; i++) mx[i] += mx[i - 1];
  for (int i = 1; i <= n; i++) scanf("%lf", &mn[i]);
  for (int i = 1; i <= n; i++) mn[i] += mn[i - 1];
  for (int i = 1; i <= n; i++)
    calc(1.0, -(mx[i] + mn[i]), mx[i], ans1[i], ans2[i]);
  for (int i = 1; i <= n; i++) printf("%.8lf ", ans1[i] - ans1[i - 1]);
  puts("");
  for (int i = 1; i <= n; i++) printf("%.8lf ", ans2[i] - ans2[i - 1]);
  puts("");
  return 0;
}
