#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5;
vector<int> G[MAX_N];
int sz[MAX_N];
double dp[MAX_N];
void dfs1(int now, int par) {
  for (int nx : G[now]) {
    if (par == nx) continue;
    dfs1(nx, now);
    sz[now] += sz[nx];
  }
  sz[now]++;
}
void dfs2(int now, int par) {
  if (par == -1) {
    dp[now] = 1;
  } else {
    dp[now] = dp[par] + 1.0 * (sz[par] - sz[now] + 1) / 2.0;
  }
  for (int nx : G[now]) {
    if (par == nx) continue;
    dfs2(nx, now);
  }
}
int main() {
  int n, tmp;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &tmp);
    G[tmp].push_back(i);
    G[i].push_back(tmp);
  }
  dfs1(1, -1);
  dfs2(1, -1);
  for (int i = 1; i <= n; i++) {
    printf("%.7f ", dp[i]);
  }
  return 0;
}
