#include <bits/stdc++.h>
using namespace std;
vector<int> gr[200005], allsize[200005];
int n, sz[200005];
double ans[200005];
void dfs(int now, int par) {
  for (auto to : gr[now]) {
    if (to == par) continue;
    dfs(to, now);
    sz[now] += sz[to];
    allsize[now].push_back(sz[to]);
  }
  sz[now]++;
}
void solve(int now, int par) {
  double p = ans[now];
  int tot = 0;
  for (auto to : gr[now])
    if (to != par) tot += sz[to];
  for (auto to : gr[now]) {
    if (to == par) continue;
    ans[to] = p + 1.0 + (tot - sz[to]) / 2.0;
  }
  for (auto to : gr[now]) {
    if (to == par) continue;
    solve(to, now);
  }
}
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    scanf("%d", &j);
    gr[j].push_back(i);
  }
  dfs(1, -1);
  ans[1] = 1.0;
  solve(1, -1);
  for (i = 1; i <= n; i++) printf("%.6f ", ans[i]);
  return 0;
}
