#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
int h[100005];
long double val[100005];
void dfs(int node) {
  int i;
  for (i = 0; i < adj[node].size(); i++) {
    dfs(adj[node][i]);
    h[node] += h[adj[node][i]];
  }
  h[node]++;
}
void dfs1(int node, long double x) {
  int i, sum = 0;
  for (i = 0; i < adj[node].size(); i++) {
    sum += h[adj[node][i]];
  }
  for (i = 0; i < adj[node].size(); i++) {
    val[adj[node][i]] =
        val[node] + (sum - h[adj[node][i]]) / 2.000000 + 1.000000;
    dfs1(adj[node][i], val[adj[node][i]]);
  }
}
int main() {
  int n;
  int i;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    adj[p].push_back(i);
  }
  val[1] = 1.000000;
  dfs(1);
  dfs1(1, 1.000000);
  cout.precision(8);
  for (i = 1; i <= n; i++) {
    cout << fixed << val[i] << " ";
  }
}
