#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T& rd(T& x) {
  int f = 1, c = getchar();
  x = 0;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
  return x;
}
template <class T>
inline T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
inline T mod(T a, T b) {
  T ret = a % b;
  if (ret < 0) ret += b;
  return ret;
}
const int oo = 0x3f3f3f3f;
const int MOD = 998244353;
const int maxn = 100005;
const int maxm = maxn * 4;
struct edge {
  int u, v, nxt;
} e[maxm];
int l = 0;
int siz[maxn], head[maxn], cnt[maxn];
double tim[maxn];
inline void add(int u, int v) {
  e[++l] = (edge){u, v, head[u]};
  head[u] = l;
  e[++l] = (edge){v, u, head[v]};
  head[v] = l;
}
int dfs1(int u, int fa) {
  siz[u] = 1;
  cnt[u] = 0;
  for (int i = head[u]; i != -1; i = e[i].nxt) {
    int v = e[i].v;
    if (v != fa) {
      ++cnt[u];
      siz[u] += dfs1(v, u);
    }
  }
  return siz[u];
}
void dfs2(int u, int fa) {
  for (int i = head[u]; i != -1; i = e[i].nxt) {
    int v = e[i].v;
    if (v != fa) {
      if (cnt[u] > 1)
        tim[v] = tim[u] + (double)(siz[u] - 1 - siz[v]) / 2.0 + 1.0;
      else
        tim[v] = tim[u] + 1.0;
      dfs2(v, u);
    }
  }
}
int main() {
  int n, tmp;
  memset(head, -1, sizeof(head));
  rd(n);
  for (register int i = (1); i <= (n); ++i) cnt[i] = 1;
  for (register int i = (2); i <= (n); ++i) add(rd(tmp), i);
  dfs1(1, 0);
  tim[1] = 1.0;
  dfs2(1, 0);
  for (register int i = (1); i <= (n); ++i) printf("%.5lf ", tim[i]);
  return 0;
}
