#include <bits/stdc++.h>
using namespace std;
const int MAX = 112345;
vector<int> edge[MAX];
double num[MAX];
void dfs(int u) {
  num[u] += 1;
  for (auto v : edge[u]) dfs(v), num[u] += num[v];
}
double fac[MAX];
void init() {
  fac[0] = 1;
  for (int i = 1; i < MAX; i++) {
    fac[i] = fac[i - 1] * i;
  }
}
double ans[MAX];
void solve(int u, double t) {
  ans[u] = t;
  for (auto v : edge[u]) {
    double S = num[u] - num[v] - 1;
    long long n = edge[u].size();
    double now;
    if (n == 1)
      solve(v, t + 1);
    else
      solve(v, t + 1 + S * n * (n - 1) / 2 / n / (n - 1));
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int f;
    scanf("%d", &f);
    edge[f].push_back(i);
  }
  dfs(1);
  solve(1, 1);
  for (int i = 1; i <= n; i++) printf("%.10f\n", ans[i]);
}
