#include <bits/stdc++.h>
using namespace std;
int countChildren(const int v, const vector<vector<int> >& gr,
                  vector<int>& totalChildren) {
  int children = 0;
  for (int child : gr[v]) {
    children += countChildren(child, gr, totalChildren) + 1;
  }
  totalChildren[v] = children;
  return children;
}
void dfs(const int v, const double answer, const vector<vector<int> >& gr,
         const vector<int>& totalChildren, vector<double>& answers) {
  answers[v] = answer;
  for (int child : gr[v]) {
    const double nextAnswer =
        answer + (totalChildren[v] - totalChildren[child] + 1) * 0.5;
    dfs(child, nextAnswer, gr, totalChildren, answers);
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> parents(n);
  vector<vector<int> > gr(n);
  for (int i = 1; i < n; ++i) {
    cin >> parents[i];
    parents[i] -= 1;
    gr[parents[i]].push_back(i);
  }
  vector<int> totalChildren(n);
  countChildren(0, gr, totalChildren);
  vector<double> answers(n);
  dfs(0, 1, gr, totalChildren, answers);
  for (double ans : answers) cout << ans << ' ';
  cout << endl;
}
