#include <bits/stdc++.h>
using namespace std;
int n, tot, head[100001], v[100001], nxt[100001], sz[100001];
double mean[100001];
void addedge(int x, int y) {
  v[++tot] = y;
  nxt[tot] = head[x];
  head[x] = tot;
}
void dfs1(int x) {
  sz[x] = 1;
  for (int i = head[x]; ~i; i = nxt[i]) {
    dfs1(v[i]);
    sz[x] += sz[v[i]];
  }
}
void dfs2(int x) {
  for (int i = head[x]; ~i; i = nxt[i]) {
    mean[v[i]] = double(sz[x] - sz[v[i]] - 1) / 2 + mean[x] + 1;
    dfs2(v[i]);
  }
}
int main() {
  memset(head, -1, sizeof(head));
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    addedge(x, i);
  }
  dfs1(1);
  mean[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; i++) printf("%.2lf ", mean[i]);
}
