#include <bits/stdc++.h>
using namespace std;
long long vis[100000 + 9], son[100000 + 9];
float dis[100000 + 9];
vector<long long> v[100000 + 9];
void dfs(long long s, long long p) {
  long long sum = 0;
  for (auto i : v[s]) {
    if (i != p) {
      dfs(i, s);
      sum += (1 + son[i]);
    }
  }
  son[s] = sum;
}
void d(long long s) {
  vis[s] = 1;
  for (auto i : v[s]) {
    if (!vis[i]) {
      dis[i] = dis[s] + 1.0 + (son[s] - son[i] - 1) / 2.0;
      d(i);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long i, n;
  cin >> n;
  for (i = 2; i <= n; i++) {
    long long x;
    cin >> x;
    v[x].push_back(i);
    v[i].push_back(x);
  }
  dfs(1, -1);
  dis[1] = 1;
  d(1);
  for (i = 1; i <= n; i++) cout << fixed << setprecision(10) << dis[i] << " ";
}
