#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> G(100011);
int n, p, dep[100011], sz[100011];
void dfs(int v) {
  sz[v] = 1;
  for (auto x : G[v]) {
    dep[x] = dep[v] + 1;
    dfs(x);
    sz[v] += sz[x];
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &p);
    G[p].push_back(i);
  }
  dfs(1);
  for (int i = 1; i <= n; ++i) {
    double ans = (n - dep[i] - sz[i]) / 2.0 + dep[i] + 1;
    printf("%.1f ", ans);
  }
  return 0;
}
