#include <bits/stdc++.h>
using namespace std;
inline void read(int& buf) {
  buf = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    buf = buf * 10 + c - '0';
    c = getchar();
  }
}
const int maxn = 1e5 + 3;
vector<int> G[maxn];
int sub[maxn], dep[maxn], n;
int dfs(int rt, int dd) {
  int cnt = 1;
  dep[rt] = dd;
  int bound = G[rt].size();
  for (int i = 0; i < bound; i++) {
    int to = G[rt][i];
    cnt += dfs(to, dd + 1);
  }
  return sub[rt] = cnt;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < maxn; i++) G[i].clear();
    memset(sub, 0, sizeof(sub));
    memset(dep, 0, sizeof(dep));
    for (int i = 2; i <= n; i++) {
      int pre;
      read(pre);
      G[pre].push_back(i);
    }
    dfs(1, 1);
    for (int i = 1; i <= n; i++) {
      if (i > 1) putchar(' ');
      printf("%lf", dep[i] + (n - sub[i] - dep[i] + 1) / 2.0);
    }
    putchar('\n');
  }
  return 0;
}
