#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
struct Edge {
  int v, next;
} edge[N << 1];
int head[N], tot, n, dep[N], son[N];
void add(int u, int v) {
  edge[tot].v = v;
  edge[tot].next = head[u];
  head[u] = tot++;
}
double ret[N];
void dfs(int u, int f) {
  son[u] = 1;
  dep[u] = dep[f] + 1;
  for (int i = head[u]; ~i; i = edge[i].next) {
    int v = edge[i].v;
    dfs(v, u);
    son[u] += son[v];
  }
  ret[u] = 1.0 * (n - dep[u] + 1 - son[u]) / 2.0 + dep[u];
}
int main() {
  scanf("%d", &n);
  memset(head, -1, sizeof(head));
  for (int i = 2; i <= n; ++i) {
    int u;
    scanf("%d", &u);
    add(u, i);
  }
  dfs(1, 0);
  for (int i = 1; i < n; ++i) printf("%.1f ", ret[i]);
  printf("%.1f\n", ret[n]);
  return 0;
}
