#include <bits/stdc++.h>
using namespace std;
vector<long long int> count1;
vector<vector<int> > graph;
long long int fillcount(int n) {
  long long int cnt = 1;
  for (vector<int>::iterator iter = graph[n].begin(); iter != graph[n].end();
       iter++) {
    cnt += fillcount(*iter);
  }
  count1[n] = cnt;
  return cnt;
}
int main() {
  long long int n, p;
  vector<long double> ans;
  cin >> n;
  ans = vector<long double>(n);
  graph = vector<vector<int> >(n);
  for (int i = 1; i < n; i++) {
    cin >> p;
    p--;
    graph[p].push_back(i);
  }
  count1 = vector<long long int>(n);
  fillcount(0);
  long long int nd = 0;
  ans[nd] = 1;
  queue<int> q;
  q.push(nd);
  long double x;
  while (!q.empty()) {
    nd = q.front();
    q.pop();
    for (vector<int>::iterator iter = graph[nd].begin();
         iter != graph[nd].end(); iter++) {
      x = ans[nd] + 1 + (count1[nd] - count1[*iter] - 1.0) / 2.0;
      ans[*iter] = x;
      q.push(*iter);
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
