#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
struct Graph {
  bool visited = false;
  vector<int> adjlist;
} graph[N];
int subtree[N];
int dfs(int i, int tm) {
  graph[i].visited = true;
  for (int j : graph[i].adjlist) {
    if (graph[j].visited == false) {
      tm += dfs(j, 1);
    }
  }
  return subtree[i] = tm;
}
double ans[N];
double fin[N];
void solve(int i) {
  graph[i].visited = true;
  double x = 0;
  for (int j : graph[i].adjlist) {
    if (graph[j].visited == false) {
      x += subtree[j];
      solve(j);
    }
  }
  ans[i] = x;
}
int main() {
  int n;
  cin >> n;
  int parent[n + 1];
  for (int i = 2; i < n + 1; ++i) {
    int x;
    scanf("%d", &parent[i]);
    x = parent[i];
    graph[x].adjlist.push_back(i);
    graph[i].adjlist.push_back(x);
  }
  dfs(1, 1);
  for (int i = 1; i < n + 1; ++i) graph[i].visited = false;
  fin[1] = 1.0;
  solve(1);
  for (int i = 2; i < n + 1; ++i) {
    fin[i] = fin[parent[i]] + (ans[parent[i]] - ans[i] - 1) / 2 + 1;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%.7lf ", fin[i]);
  }
  cout << endl;
}
