#include <bits/stdc++.h>
const int INF_INT = 0x3f3f3f3f;
const long long INF_LL = 0x7f7f7f7f;
const int MOD = 1e9 + 7;
const double eps = 1e-10;
const double pi = acos(-1);
using namespace std;
int n;
vector<int> g[100010];
int sz[100010];
double ans[100010];
void dfs1(int u) {
  sz[u] = 1;
  for (auto& v : g[u]) {
    dfs1(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u) {
  for (auto& v : g[u]) {
    ans[v] = ans[u] + 1 + (double)(sz[u] - sz[v] - 1) / 2.0;
    dfs2(v);
  }
}
int main(int argc, char const* argv[]) {
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; i++) g[i].clear(), sz[i] = 0, ans[i] = 0;
    for (int i = 2; i <= n; i++) {
      int x;
      scanf("%d", &x);
      g[x].push_back(i);
    }
    dfs1(1);
    ans[1] = 1;
    dfs2(1);
    for (int i = 1; i <= n; i++) printf("%f\n", ans[i]);
  }
  return 0;
}
