#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
int n, sz[N];
vector<int> G[N];
double f[N];
void dfs1(int u) {
  sz[u] = 1;
  for (int v : G[u]) {
    dfs1(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u) {
  for (int v : G[u]) {
    f[v] = f[u] + 1 + (sz[u] - sz[v] - 1) * 0.5;
    dfs2(v);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  clock_t _ = clock();
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; ++i) G[i].clear();
    for (int i = 2; i <= n; ++i) {
      int f;
      scanf("%d", &f);
      G[f].push_back(i);
    }
    dfs1(1);
    f[1] = 1;
    dfs2(1);
    for (int i = 1; i <= n; ++i) printf("%.1f%c", f[i], " \n"[i == n]);
  }
  return 0;
}
