#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mm = 10005;
const int MOD = 1000000;
const int INF = 1e9 + 2;
double dp[N];
int s[N];
vector<int> G[N];
void dfs1(int u) {
  s[u] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    dfs1(v);
    s[u] += s[v];
  }
}
void dfs(int u, int fa) {
  if (u != 1) {
    int sz = (int)G[fa].size();
    int left = s[fa] - s[u] - 1;
    dp[u] = dp[fa] + 1 + 0.5 * left;
  }
  for (int i = 0; i < G[u].size(); i++) dfs(G[u][i], u);
}
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    G[x].push_back(i);
  }
  dfs1(1);
  dp[1] = 1.0;
  dfs(1, 0);
  for (int i = 1; i <= n; i++) cout << dp[i] << ' ';
  return 0;
}
