#include <bits/stdc++.h>
using namespace std;
int size[100005];
int head[100005 << 1];
double dp[100005];
int n, cnt;
struct node {
  int nex, to;
} e[100005 << 1];
void add(int u, int v) {
  e[++cnt].to = v;
  e[cnt].nex = head[u];
  head[u] = cnt;
}
void dfs1(int now, int fa) {
  size[now] = 1;
  for (register int i = head[now]; i; i = e[i].nex) {
    int to = e[i].to;
    if (to == fa) {
      continue;
    }
    dfs1(to, now);
    size[now] += size[to];
  }
}
void dfs2(int now, int fa) {
  for (register int i = head[now]; i; i = e[i].nex) {
    int to = e[i].to;
    if (to == fa) {
      continue;
    }
    dp[to] = dp[now] + 1.0 + (size[now] - size[to] - 1) * 1.0 / 2.0;
    dfs2(to, now);
  }
}
int main() {
  scanf("%d", &n);
  for (register int i = 2; i <= n; i++) {
    int a;
    scanf("%d", &a);
    add(a, i), add(i, a);
  }
  dfs1(1, -1);
  dp[1] = 1.0;
  dfs2(1, -1);
  for (register int i = 1; i <= n; i++) {
    printf("%.6lf ", dp[i]);
  }
  return 0;
}
