#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
struct edge {
  int to, next;
} e[maxn];
int n, tot, head[maxn];
int size[maxn];
double E[maxn];
inline void add(int u, int v) {
  e[++tot].to = v;
  e[tot].next = head[u];
  head[u] = tot;
}
inline void dfs1(int u) {
  size[u] = 1;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    dfs1(v);
    size[u] += size[v];
  }
}
inline void dfs2(int u) {
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    E[v] = E[u] + 1.0 + (size[u] - size[v] - 1) / 2.0;
    dfs2(v);
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int a;
    scanf("%d", &a);
    add(a, i);
  }
  dfs1(1);
  E[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; i++) printf("%.1f ", E[i]);
  return 0;
}
