#include <bits/stdc++.h>
using namespace std;
const int me = 100025;
int n, x;
vector<int> v[me];
int par[me], sz[me];
long double t[me];
void dfs1(int x, int p) {
  sz[x] = 1;
  for (int i : v[x]) {
    if (i == p) continue;
    dfs1(i, x);
  }
  for (int i : v[x])
    if (i != p) sz[x] += sz[i];
}
void dfs2(int x, int p) {
  if (x == 1) {
    t[x] = 1.;
  } else {
    int all_children = sz[par[x]] - sz[x] - 1;
    t[x] = t[par[x]] + (1. * all_children) / 2. + 1.;
  }
  for (int i : v[x]) {
    if (i == p) continue;
    dfs2(i, x);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &par[i]);
    v[par[i]].push_back(i);
  }
  dfs1(1, -1);
  dfs2(1, -1);
  cout.precision(10);
  for (int i = 1; i <= n; i++) cout << fixed << t[i] << " ";
  printf("\n");
  return 0;
}
