#include <bits/stdc++.h>
using namespace std;
vector<int> g[100010];
int n;
int fa[100010], son[100010], h[100010], que[100010], chu[100010];
void getson() {
  int top = 0, x, y;
  memset(son, 0, sizeof(son));
  for (int i = 1; i <= n; ++i)
    if (chu[i] == 0) que[++top] = i;
  while (top) {
    x = que[top--];
    for (int i = 0; i < g[x].size(); ++i) {
      y = g[x][i];
      son[x] += son[y] + 1;
    }
    --chu[fa[x]];
    if (chu[fa[x]] == 0) que[++top] = fa[x];
  }
}
void geth() {
  int s = 0, t = 1, x, y;
  que[1] = 1;
  h[1] = 1;
  while (s < t) {
    x = que[++s];
    for (int i = 0; i < g[x].size(); ++i) {
      y = g[x][i];
      h[y] = h[x] + 1;
      que[++t] = y;
    }
  }
}
int main() {
  scanf("%d", &n);
  int x;
  memset(chu, 0, sizeof(chu));
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &x);
    g[x].push_back(i);
    fa[i] = x;
    ++chu[x];
  }
  getson();
  geth();
  double ave;
  for (int i = 1; i <= n; ++i) {
    ave = (h[i] + n - son[i]) / 2.0;
    printf("%lf ", ave);
  }
  return 0;
}
