#include <bits/stdc++.h>
using namespace std;
const int Len = 1e5 + 5;
int n, m, siz[Len], head[Len], cnt;
struct node {
  int next, to;
} edge[Len << 1];
void add(int from, int to) {
  edge[++cnt].to = to;
  edge[cnt].next = head[from];
  head[from] = cnt;
}
double dp[Len];
void dfs1(int x, int f) {
  siz[x] = 1;
  for (int e = head[x]; e; e = edge[e].next) {
    int to = edge[e].to;
    if (to == f) continue;
    dfs1(to, x);
    siz[x] += siz[to];
  }
}
void dfs2(int x, int f) {
  if (x != 1) dp[x] = dp[f] + 1.0 + (siz[f] - siz[x] - 1) / 2.0;
  for (int e = head[x]; e; e = edge[e].next) {
    int to = edge[e].to;
    if (to == f) continue;
    dfs2(to, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    add(x, i), add(i, x);
  }
  dfs1(1, 0);
  dp[1] = 1.0;
  dfs2(1, 0);
  for (int i = 1; i <= n; i++) printf("%.1lf\n", dp[i]);
  return 0;
}
