#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int N;
struct EdgeNode {
  int next, to;
} edge[100010 << 1];
int head[100010], cnt = 1, size[100010];
inline void AddEdge(int u, int v) {
  cnt++;
  edge[cnt].next = head[u];
  head[u] = cnt;
  edge[cnt].to = v;
}
inline void InsertEdge(int u, int v) {
  AddEdge(u, v);
  AddEdge(v, u);
}
double f[100010];
void DFS_1(int now, int last) {
  size[now] = 1;
  for (int i = head[now]; i; i = edge[i].next)
    if (edge[i].to != last)
      DFS_1(edge[i].to, now), size[now] += size[edge[i].to];
}
void DFS_2(int now, int last) {
  for (int i = head[now]; i; i = edge[i].next)
    if (edge[i].to != last)
      f[edge[i].to] =
          f[now] + 1 + (double)(size[now] - size[edge[i].to] - 1) / 2,
      DFS_2(edge[i].to, now);
}
int main() {
  N = read();
  for (int x, i = 2; i <= N; i++) x = read(), InsertEdge(x, i);
  DFS_1(1, 0);
  f[1] = 1;
  DFS_2(1, 0);
  for (int i = 1; i <= N; i++) printf("%.1lf ", f[i]);
  return 0;
}
