#include <bits/stdc++.h>
long long n, i, j, h, k, t, d, m;
long double f[200005], a[200005], c[200005];
using namespace std;
vector<int> x[200005];
long double fg(long long n) {
  if (f[n] != 0) return f[n];
  long double res = 0, x = 1, m;
  for (int i = n; i >= 2; i--) {
    m = i;
    res += 1 / m * x;
    x *= (m - 2) / m;
  }
  f[n] = res;
  return res;
}
void xl(long long i) {
  long double j, k = fg(x[i].size()), d = a[i] + 1;
  for (j = 0; j < x[i].size(); j++) d += k * c[x[i][j]];
  for (j = 0; j < x[i].size(); j++) {
    a[x[i][j]] = d - k * c[x[i][j]];
    xl(x[i][j]);
  }
}
void dfs(long long i) {
  c[i] = 1;
  for (int j = 0; j < x[i].size(); j++) {
    dfs(x[i][j]);
    c[i] += c[x[i][j]];
  }
}
int main() {
  cin >> n;
  for (i = 2; i <= n; i++) {
    cin >> h;
    x[h].push_back(i);
  }
  a[1] = 1;
  dfs(1);
  xl(1);
  cout << fixed;
  for (i = 1; i <= n; i++) cout << setprecision(9) << a[i] << ' ';
}
