#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 11;
vector<int> g[N];
int sz[N], L[N], ans[N];
int dfs(int v, int l) {
  sz[v] = 1;
  L[v] = l;
  for (int w : g[v]) sz[v] += dfs(w, l + 1);
  return sz[v];
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    g[u].push_back(i);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    if (i > 1) putchar(' ');
    printf("%lf", 0.5 * (n - sz[i] - L[i]) + L[i] + 1);
  }
  putchar(10);
  return 0;
}
