#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const long long mod = 1e9 + 7;
inline long long read() {
  long long X = 0;
  bool flag = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    X = (X << 1) + (X << 3) + ch - '0';
    ch = getchar();
  }
  if (flag) return X;
  return ~(X - 1);
}
long long n, m;
long long ar[N];
struct EDGE {
  int v, nxt;
} ed[N];
int head[N], tot;
void add_edge(int u, int v) {
  ed[++tot].v = v;
  ed[tot].nxt = head[u];
  head[u] = tot;
}
double as[N];
int sz[N];
void dfs1(int u) {
  sz[u] = 1;
  for (int i = head[u]; i; i = ed[i].nxt) {
    int v = ed[i].v;
    dfs1(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u) {
  for (int i = head[u]; i; i = ed[i].nxt) {
    int v = ed[i].v;
    as[v] = as[u] + 1.0 + (sz[u] - sz[v] - 1.0) * 0.5;
    dfs2(v);
  }
}
void solvve() {
  n = read();
  for (int i(2); i <= n; ++i) {
    int t = read();
    add_edge(t, i);
  }
  as[1] = 1.0;
  dfs1(1);
  dfs2(1);
  for (int i(1); i <= n; ++i) printf("%.8f ", as[i]);
  puts("");
}
int main() {
  { solvve(); }
  return 0;
}
