#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
int parent[100005] = {0};
int sz[100005] = {0};
double ans[100005];
double fact[100005];
void rec(int x, int p, double eval) {
  int s = sz[p] - sz[x] - 1;
  ans[x] = eval + s / 2.0 + 1;
  for (int q : v[x]) rec(q, x, ans[x]);
}
int dfs(int x, int p) {
  sz[x] = 1;
  for (int q : v[x])
    if (p != q) sz[x] += dfs(q, x);
  return sz[x];
}
int main() {
  int n;
  cin >> n;
  for (int i = (int)(2); i <= (int)(n); i++) {
    cin >> parent[i];
    v[parent[i]].push_back(i);
  }
  dfs(1, -1);
  ans[1] = 1.0;
  for (int q : v[1]) rec(q, 1, 1.0);
  for (int i = (int)(1); i <= (int)(n); i++) printf("%0.6lf ", ans[i]);
}
