#include <bits/stdc++.h>
using namespace std;
vector<int> V[100045];
double size[100045];
int par[100045];
double ans[100045];
void dfs(int v) {
  size[v] = 1;
  for (int i = 0; i < V[v].size(); i++) dfs(V[v][i]);
  for (int i = 0; i < V[v].size(); i++) size[v] += size[V[v][i]];
}
void bfs(int st) {
  queue<int> q;
  q.push(st);
  while (!q.empty()) {
    int top = q.front();
    q.pop();
    if (top != 1)
      ans[top] =
          ans[par[top]] + 1.00 + 0.5 * (size[par[top]] - size[top] - 1.0);
    for (int i = 0; i < V[top].size(); i++) q.push(V[top][i]);
  }
}
int main() {
  ans[1] = 1.0;
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    V[u].push_back(i);
    par[i] = u;
  }
  dfs(1);
  bfs(1);
  for (int i = 1; i <= n; i++)
    cout << fixed << setprecision(7) << ans[i] << " ";
}
