#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 9;
long long n, cnt;
long long val[N];
double ans[N];
long long last[N];
struct edge {
  long long to, pre;
} e[N];
inline void add(long long x, long long y) {
  e[++cnt] = (edge){y, last[x]};
  last[x] = cnt;
}
void dfs(long long x, long long fa) {
  for (long long i = last[x]; i; i = e[i].pre) {
    long long to = e[i].to;
    dfs(to, x);
    val[x] += val[to];
  }
  val[x]++;
  return;
}
void work(long long x) {
  for (long long i = last[x]; i; i = e[i].pre) {
    long long to = e[i].to;
    ans[to] = (val[x] - 1 - val[to]) * 0.5 + 1.0 + ans[x];
    work(to);
  }
}
signed main() {
  scanf("%lld", &n);
  for (long long i = 2; i <= n; i++) {
    long long fa;
    scanf("%lld", &fa);
    add(fa, i);
  }
  ans[1] = 1.0;
  dfs(1, 0);
  work(1);
  for (long long i = 1; i <= n; i++) printf("%.6lf ", ans[i]);
  return 0;
}
