#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int n;
int vis[maxn], siz[maxn], fa[maxn];
double ans[maxn];
vector<int> e[maxn];
void dfs(int u) {
  vis[u] = 1;
  siz[u] = 1;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (!vis[v]) dfs(v);
    siz[u] += siz[v];
    ;
  }
}
void dfs2(int u) {
  vis[u] = 1;
  ans[u] = ((double)(siz[fa[u]] - siz[u] - 1) / 2) + (double)ans[fa[u]] + 1;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (!vis[v]) dfs2(v);
  }
}
int main() {
  scanf("%d", &n);
  memset(vis, 0, sizeof(vis));
  for (int i = 2; i < n + 1; i++) {
    scanf("%d", &fa[i]);
    e[fa[i]].push_back(i);
  }
  dfs(1);
  memset(vis, 0, sizeof(vis));
  vis[1] = 1;
  ans[1] = 1;
  for (int i = 0; i < e[1].size(); i++) dfs2(e[1][i]);
  for (int i = 1; i < n + 1; i++) printf("%.2f ", ans[i]);
  printf("\n");
  return 0;
}
