#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
const long long M = 1e5 + 10;
long long n;
double maxn[M], minn[M], sum1[M], sum2[M], p1[M], p2[M];
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> maxn[i];
  for (long long i = 1; i <= n; i++) cin >> minn[i];
  for (long long i = 1; i <= n; i++) sum1[i] = maxn[i] + sum1[i - 1];
  for (long long i = n; i >= 1; i--) sum2[i] = minn[i] + sum2[i + 1];
  for (long long i = 1; i <= n; i++) {
    double x1 = sum1[i], x2 = sum1[i] - sum2[i + 1] + 1;
    double d = sqrt(max(x2 * x2 - 4 * x1, 0.0));
    p1[i] = (x2 - d) / 2.0, p2[i] = (x2 + d) / 2.0;
  }
  for (long long i = 1; i <= n; i++) printf("%.8lf ", p1[i] - p1[i - 1]);
  puts("");
  for (long long i = 1; i <= n; i++) printf("%.8lf ", p2[i] - p2[i - 1]);
  puts("");
  return 0;
}
