#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  T ans = 0;
  short f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ans = (ans << 1) + (ans << 3) + (ch ^ 48);
    ch = getchar();
  }
  x = ans * f;
}
int n;
int siz[100010];
double f[100010];
int x;
int head[100010], Next[100010 << 1], ver[100010 << 1], tot;
void add(int x, int y) {
  ver[++tot] = y;
  Next[tot] = head[x];
  head[x] = tot;
}
void dfs(int x, int fa) {
  siz[x] = 1;
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i];
    if (y == fa) continue;
    dfs(y, x);
    siz[x] += siz[y];
  }
}
void DFS(int x, int fa) {
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i];
    if (y == fa) continue;
    f[y] = f[x] + 1 + (siz[x] - siz[y] - 1) / 2.0;
    DFS(y, x);
  }
}
signed main() {
  read(n);
  for (int i = 2; i <= n; i++) read(x), add(i, x), add(x, i);
  dfs(1, -1);
  f[1] = 1;
  DFS(1, -1);
  for (int i = 1; i <= n; i++) printf("%.1lf ", f[i]);
}
