#include <bits/stdc++.h>
using namespace std;
vector<double> solve(int n, vector<int> parents) {
  auto size = vector<int>(n);
  for (auto i = n - 1; i >= 0; i--) {
    size[i]++;
    if (i != 0) size[parents[i]] += size[i];
  }
  auto answer = vector<double>(n);
  answer[0] = 1;
  for (auto i = 1; i < n; i++) {
    auto p = parents[i];
    auto total = static_cast<double>(size[p] - 1);
    answer[i] = answer[p] + 1 + (total - size[i]) / 2;
  }
  return answer;
}
int main() {
  int n;
  scanf("%d", &n);
  auto parents = vector<int>(n);
  for (auto i = 1; i < n; i++) {
    scanf("%d", &parents[i]);
    parents[i]--;
  }
  auto answer = solve(n, parents);
  for (auto x : answer) printf("%lf ", x);
  printf("\n");
}
