#include <bits/stdc++.h>
using namespace std;
vector<int> G[100005];
int n, sizen[100005];
double dp[100005];
void dfs1(int now) {
  sizen[now] = 1;
  for (unsigned int i = 0; i < G[now].size(); ++i) {
    int to = G[now][i];
    dfs1(to);
    sizen[now] += sizen[to];
  }
}
void dfs2(int now) {
  for (unsigned int i = 0; i < G[now].size(); ++i) {
    int to = G[now][i];
    dp[to] = dp[now] + 1 +
             (double)((double)sizen[now] - (double)sizen[to] - 1) / (double)2;
    dfs2(to);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int fa;
    scanf("%d", &fa);
    G[fa].push_back(i);
  }
  dfs1(1);
  dp[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; ++i) printf("%.1f ", dp[i]);
  return 0;
}
