#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 100;
vector<int> ch[N];
int n;
double ans[N];
int h[N], sz[N];
int dfs(int v) {
  sz[v] = 1;
  for (int to : ch[v]) {
    h[to] = h[v] + 1;
    sz[v] += dfs(to);
  }
  ans[v] = h[v] + (n - h[v] - sz[v]) / 2.;
  return sz[v];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int p;
    scanf("%d", &p);
    ch[p - 1].push_back(i);
  }
  dfs(0);
  for (int i = 0; i < n; i++) {
    printf("%.10lf ", ans[i] + 1);
  }
  printf("\n");
  return 0;
}
