#include <bits/stdc++.h>
using namespace std;
int n, m, T;
double dp[100005];
vector<int> E[100005];
int Size[100005], f[100005];
void pre_dfs(int x) {
  Size[x] = 1;
  for (int i = 0; i < E[x].size(); i++) {
    int u = E[x][i];
    pre_dfs(u);
    Size[x] += Size[u];
  }
}
void dfs(int x) {
  for (int i = 0; i < E[x].size(); i++) {
    int u = E[x][i];
    dp[u] = dp[x] + 1.0 + (Size[x] - Size[u] - 1) * 1.0 / 2;
    dfs(u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) scanf("%d", f + i), E[f[i]].push_back(i);
  pre_dfs(1), dp[1] = 1.00, dfs(1);
  for (int i = 1; i <= n; i++) printf("%lf ", dp[i]);
}
