#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> G[100000 + 10];
int sz[100000 + 10];
void dfs_init(int u, int fa) {
  sz[u] = 1;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs_init(v, u);
    sz[u] += sz[v];
  }
}
double ans[100000 + 10];
void dfs(int u, int fa) {
  if (u == 1) ans[u] = 1.0;
  int tot = sz[u] - 1;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == fa) continue;
    ans[v] = ans[u] + (tot - sz[v] + 0.0) / 2 + 1;
  }
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    G[i].push_back(p);
    G[p].push_back(i);
  }
  dfs_init(1, -1);
  dfs(1, -1);
  for (int i = 1; i <= n; ++i) printf("%.12f ", ans[i]);
  return 0;
}
