#include <bits/stdc++.h>
using namespace std;
int h[200010], v[200010], nxt[200010], n, ec, x, d[200010], s[200010];
double f[200010];
void add(int x, int y) {
  v[++ec] = y;
  nxt[ec] = h[x];
  h[x] = ec;
}
void dfs(int x, int fa) {
  s[x] = 1;
  for (int i = h[x]; i; i = nxt[i])
    if (v[i] != fa) {
      dfs(v[i], x);
      s[x] += s[v[i]];
    }
}
void get(int x, int fa) {
  for (int i = h[x]; i; i = nxt[i])
    if (v[i] != fa) {
      f[v[i]] = f[x] + (s[x] - s[v[i]] + 1.0) / 2.0;
      get(v[i], x);
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    add(i, x);
    add(x, i);
  }
  f[1] = 1;
  dfs(1, 0);
  get(1, 0);
  for (int i = 1; i <= n; i++) printf("%.1lf ", f[i]);
}
