#include <bits/stdc++.h>
using namespace std;
int n, S[100005];
double dp[100005];
vector<int> tree[100005];
void dfs(int x, int f) {
  S[x] = 1;
  for (int i = 0; i < tree[x].size(); i++) {
    int to = tree[x][i];
    if (to == f) continue;
    dfs(to, x);
    S[x] += S[to];
  }
}
void DP(int x, int f) {
  for (int i = 0; i < tree[x].size(); i++) {
    int to = tree[x][i];
    if (to == f) continue;
    dp[to] = dp[x] + 1.0 * (S[x] - S[to] - 1) / 2.0 + 1;
    DP(to, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    tree[x].push_back(i);
    tree[i].push_back(x);
  }
  dp[1] = 1;
  dfs(1, 0);
  DP(1, 0);
  for (int i = 1; i <= n; i++) {
    printf("%.6f ", dp[i]);
  }
  return 0;
}
