#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
struct edge {
  int to, nxt;
} ed[MAXN << 1];
int head[MAXN], tsize[MAXN], ed_cnt = 0;
double res[MAXN];
void addedge(int u, int v) {
  ed[++ed_cnt] = (edge){v, head[u]};
  head[u] = ed_cnt;
  ed[++ed_cnt] = (edge){u, head[v]};
  head[v] = ed_cnt;
}
void dfs(int u, int pa) {
  tsize[u] = 1;
  for (int i = head[u]; i; i = ed[i].nxt) {
    int v = ed[i].to;
    if (v == pa) continue;
    dfs(v, u);
    tsize[u] += tsize[v];
  }
}
void dfs2(int u, int pa, double r) {
  res[u] = r;
  for (int i = head[u]; i; i = ed[i].nxt) {
    int v = ed[i].to;
    if (v == pa) continue;
    dfs2(v, u, r + double(tsize[u] - tsize[v] - 1) / 2.0 + 1.0);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    addedge(x, i);
  }
  dfs(1, 0);
  dfs2(1, 0, 1.0);
  for (int i = 1; i <= n; ++i) printf("%.2f ", res[i]);
  return 0;
}
