#include <bits/stdc++.h>
int num[100005], to[100005], ne[100005], fi[200005], i, n, x, tot;
double f[100005];
void add(int x, int y) {
  to[++tot] = y;
  ne[tot] = fi[x];
  fi[x] = tot;
}
void dfs(int x) {
  num[x] = 1;
  for (int i = fi[x]; i; i = ne[i]) dfs(to[i]), num[x] += num[to[i]];
}
void dp(int x) {
  for (int i = fi[x]; i; i = ne[i]) {
    f[to[i]] = f[x] + 1 + 0.5 * (num[x] - 1 - num[to[i]]);
    dp(to[i]);
  }
}
int main() {
  scanf("%d\n", &n);
  for (i = 2; i <= n; ++i) scanf("%d", &x), add(x, i);
  dfs(1);
  f[1] = 1;
  dp(1);
  for (i = 1; i <= n; ++i) printf("%.10f ", f[i]);
}
