#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<vector<int> > g(n + 1);
  for (int p = 2; p <= n; p++) {
    int u;
    cin >> u;
    g[u].push_back(p);
    g[p].push_back(u);
  }
  vector<int> ss(n + 1);
  function<void(int, int)> dfs_sz = [&](int u, int p) -> void {
    ss[u] = 1;
    for (int v : g[u]) {
      if (v == p) continue;
      dfs_sz(v, u);
      ss[u] += ss[v];
    }
  };
  dfs_sz(1, -1);
  vector<double> exp(n + 1);
  function<void(int, int)> solve = [&](int u, int p) -> void {
    if (p == -1) {
      exp[u] = 1;
    } else {
      exp[u] = exp[p] + 1 + (ss[p] - ss[u] - 1) / 2.0;
    }
    for (int v : g[u]) {
      if (v == p) continue;
      solve(v, u);
    }
  };
  solve(1, -1);
  for (int i = 1; i <= n; i++)
    cout << fixed << setprecision(12) << exp[i] << " \n"[i == n];
  return (0);
}
