#include <bits/stdc++.h>
using namespace std;
vector<int> v[100003];
double start[100003];
int deep[100003] = {0};
void dfs(int from) {
  if (v[from].size() == 0)
    deep[from] = 1;
  else {
    for (int i = 0; i < v[from].size(); i++) {
      if (deep[v[from][i]] == 0) {
        deep[v[from][i]] += 1;
        dfs(v[from][i]);
        deep[from] += deep[v[from][i]];
      }
    }
  }
}
void dfss(int from) {
  int tmp = 0;
  for (int i = 0; i < v[from].size(); i++) {
    tmp += deep[v[from][i]];
  }
  for (int i = 0; i < v[from].size(); i++) {
    start[v[from][i]] =
        (double)(start[from] + 1 + (tmp - deep[v[from][i]]) / (double)2);
    dfss(v[from][i]);
  }
}
int main() {
  int n;
  cin >> n;
  int tmp;
  for (int i = 2; i <= n; i++) {
    cin >> tmp;
    v[tmp].push_back(i);
  }
  start[1] = double(1);
  dfs(1);
  dfss(1);
  for (int i = 1; i <= n; i++) cout << start[i] << " ";
  return 0;
}
