#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(100009);
double esti[100009];
double subtree[100009];
int dfs(int cur, int prev) {
  int i;
  subtree[cur] = 1;
  for (i = 0; i < adj[cur].size(); i++) {
    subtree[cur] += dfs(adj[cur][i], cur);
  }
  return subtree[cur];
}
int dfs2(int cur, int prev) {
  int i;
  for (i = 0; i < adj[cur].size(); i++) {
    esti[adj[cur][i]] =
        esti[cur] + 1 + (1.0 * (subtree[cur] - subtree[adj[cur][i]] - 1)) / 2;
    dfs2(adj[cur][i], cur);
  }
  return 0;
}
int main() {
  int n, p, i;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> p;
    p--;
    adj[p].push_back(i);
  }
  dfs(0, -1);
  esti[0] = 1.0;
  dfs2(0, -1);
  for (i = 0; i < n; i++) {
    cout << setprecision(8) << esti[i] << " ";
  }
}
