#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> tree[N];
int n, fa[N], vis[N], sz[N];
double dp[N];
int sum[N];
void dfs1(int u) {
  vis[u] = 1;
  sz[u] = 1;
  for (auto v : tree[u]) {
    if (vis[v]) continue;
    dfs1(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u) {
  vis[u] = 1;
  for (auto v : tree[u]) {
    int b = dp[u];
    b += sz[v];
    if (vis[v]) continue;
    dp[v] = dp[u] + (sz[u] - sz[v] + 1) * 0.5;
    dfs2(v);
  }
}
int main() {
  cin >> n;
  fa[1] = 0;
  for (int i = 2; i <= n; i++) {
    cin >> fa[i];
    tree[fa[i]].push_back(i);
    tree[i].push_back(fa[i]);
  }
  dp[1] = sum[1] = 1;
  dfs1(1);
  memset(vis, 0, sizeof vis);
  dfs2(1);
  for (int i = 1; i <= n; i++) {
    printf("%.8f ", dp[i]);
  }
}
