#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int sum[maxn];
double st[maxn];
vector<int> G[maxn];
void dfs1(int u, int fa) {
  sum[u] = 1;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs1(v, u);
    sum[u] += sum[v];
  }
}
void dfs2(int u, int fa) {
  int sz = G[u].size();
  for (int i = 0; i < sz; ++i) {
    int v = G[u][i];
    if (v == fa) continue;
    st[v] = st[u] + 1.0 * (sum[u] - sum[v] - 1) / 2 + 1;
    dfs2(v, u);
  }
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) {
      G[i].clear();
    }
    for (int i = 2; i <= n; ++i) {
      int x;
      scanf("%d", &x);
      G[x].push_back(i);
    }
    dfs1(1, 0);
    st[1] = 1;
    dfs2(1, 0);
    for (int i = 1; i <= n; ++i) {
      printf("%f%c", st[i], " \n"[i == n]);
    }
  }
  return 0;
}
