#include <bits/stdc++.h>
using namespace std;
int *noofChildren;
vector<int> *allChildren;
int *parent;
int assnoofChildren(int i) {
  for (int f = 0; f < allChildren[i].size(); f++) {
    noofChildren[i] += assnoofChildren(allChildren[i][f]);
  }
  return noofChildren[i];
}
int main() {
  int n;
  cin >> n;
  parent = new int[n + 1];
  parent[0] = 0;
  parent[1] = 0;
  noofChildren = new int[n + 1];
  for (int i = 0; i <= n; i++) noofChildren[i] = 1;
  allChildren = new vector<int>[n + 1];
  for (int i = 2; i <= n; i++) {
    cin >> parent[i];
    allChildren[parent[i]].push_back(i);
  }
  assnoofChildren(1);
  for (int i = 1; i <= n; i++) {
  }
  long double *ans = new long double[n + 1];
  ans[1] = 1.0;
  for (int i = 1; i <= n; i++) {
    long double sum = 0.0;
    for (int f = 0; f < allChildren[i].size(); f++) {
      sum += (long double)noofChildren[allChildren[i][f]];
    }
    for (int f = 0; f < allChildren[i].size(); f++) {
      ans[allChildren[i][f]] =
          (sum - (long double)noofChildren[allChildren[i][f]]) / 2 + 1 + ans[i];
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
