#include <bits/stdc++.h>
int a, b, c, i;
int par[100003], v[100003], sum[100003];
std::vector<int> G[100003];
double P[100003];
void dfs(int p) {
  v[p] = 1;
  sum[p] = 1;
  for (int k = 0; k < G[p].size(); k++) {
    if (v[G[p][k]] == 0) {
      dfs(G[p][k]);
      sum[p] += sum[G[p][k]];
    }
  }
}
void dfs2(int p) {
  int S = 0, ss;
  for (int k = 0; k < G[p].size(); k++) {
    S += sum[G[p][k]];
  }
  for (int k = 0; k < G[p].size(); k++) {
    ss = S - sum[G[p][k]];
    P[G[p][k]] = P[p] + 1.0 + (double)(ss) / (double)2;
    dfs2(G[p][k]);
  }
}
int main() {
  scanf("%d", &a);
  for (i = 2; i <= a; i++) {
    scanf("%d", &par[i]);
    G[par[i]].push_back(i);
  }
  P[1] = 1.0;
  dfs(1);
  dfs2(1);
  for (i = 1; i <= a; i++) printf("%f ", P[i]);
}
