#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 1e6 + 10;
double a[N], b[N], c[N], d[N];
int main() {
  int n;
  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 = 2; i <= n; i++) a[i] = a[i - 1] + a[i];
  for (int i = n - 1; i >= 1; i--) b[i] = b[i + 1] + b[i];
  for (int i = 1; i <= n; i++) {
    double B = -(1 + a[i] - b[i + 1]);
    double C = a[i];
    double delta = max(B * B - 4.0 * C, 0.0);
    c[i] = (-B + sqrt(delta)) / 2.0;
    d[i] = (-B - sqrt(delta)) / 2.0;
  }
  for (int i = 1; i <= n; i++) printf("%.6f ", c[i] - c[i - 1]);
  puts("");
  for (int i = 1; i <= n; i++) printf("%.6f ", d[i] - d[i - 1]);
  return 0;
}
