#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> g[N];
double dp[N];
int sz[N];
void dfs(int u, int fa) {
  sz[u] = 1;
  for (auto v : g[u]) {
    if (v != fa) {
      dfs(v, u);
    }
    sz[u] += sz[v];
  }
}
void dfs2(int u, int fa) {
  for (auto v : g[u]) {
    if (v != fa) {
      dp[v] = (sz[u] - 1 - sz[v]) / 2.0 + 1 + dp[u];
    }
    dfs2(v, u);
  }
}
int main() {
  int n, v;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &v);
    g[v].push_back(i);
  }
  dp[1] = 1;
  dfs(1, 0);
  dfs2(1, 0);
  for (int i = 1; i <= n; i++) {
    printf("%.6lf ", dp[i]);
  }
}
