#include <bits/stdc++.h>
using namespace std;
vector<int> g[100005];
int f[100005];
double ans[100005];
int dfs1(int u) {
  f[u] = 1;
  int i, v;
  for (i = 0; i < (int)g[u].size(); ++i) {
    v = g[u][i];
    f[u] += dfs1(v);
  }
  return f[u];
}
void dfs2(int u, double d) {
  ans[u] = d;
  if (g[u].size() == 0) return;
  int num = f[u] - 1;
  for (int i = 0; i < g[u].size(); ++i) {
    int v = g[u][i];
    dfs2(v, ans[u] + 1 + 0.5 * (num - f[v]));
  }
}
int main() {
  int i, n, u;
  scanf("%d", &n);
  for (i = 2; i <= n; ++i) {
    scanf("%d", &u);
    g[u].push_back(i);
  }
  dfs1(1);
  dfs2(1, 1);
  for (int i = 1; i < n + 1; ++i) printf("%.10f ", ans[i]);
  return 0;
}
