#include <bits/stdc++.h>
using namespace std;
const int N = 222222;
int adj[N], v[N], nxt[N], e;
__inline void ins(int u0, int v0) {
  v[e] = v0;
  nxt[e] = adj[u0];
  adj[u0] = e++;
}
int sz[N];
int calc_sz(int x) {
  sz[x] = 1;
  for (int e = adj[x]; ~e; e = nxt[e]) sz[x] += calc_sz(v[e]);
  return sz[x];
}
double f[N];
void calc_f(int x) {
  for (int e = adj[x]; ~e; e = nxt[e]) {
    f[v[e]] = f[x] + 1 + (sz[x] - 1 - sz[v[e]]) * 0.5;
    calc_f(v[e]);
  }
}
int main() {
  memset(adj, -1, sizeof adj);
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    ins(x, i);
  }
  calc_sz(1);
  f[1] = 1;
  calc_f(1);
  for (int i = 1; i <= n; i++) printf("%.6f ", f[i]);
  puts("");
  return 0;
}
