#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e5 + 100;
struct elist {
  int v, last;
} e[MXN];
int zh[MXN], tote;
void adde(int u, int v) {
  e[tote].v = v;
  e[tote].last = zh[u];
  zh[u] = tote++;
}
int dep[MXN], size[MXN];
void dfs(int u) {
  size[u] = 1;
  for (int i = zh[u]; i != -1; i = e[i].last) {
    int v = e[i].v;
    dep[v] = dep[u] + 1;
    dfs(v);
    size[u] += size[v];
  }
}
int main(int argc, const char* argv[]) {
  memset(zh, -1, sizeof(zh));
  tote = 0;
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int v;
    scanf("%d", &v);
    adde(v, i);
  }
  dep[1] = 0;
  dfs(1);
  for (int i = 1; i <= n; i++)
    printf("%.1f%c", dep[i] + 1 + (n - dep[i] - size[i]) * 0.5,
           i == n ? '\n' : ' ');
  return 0;
}
