#include <bits/stdc++.h>
using namespace std;
vector<int> son[100100];
int sz[100100];
double ans[100100];
void dfs(int u) {
  sz[u] = 1;
  for (int v : son[u]) {
    dfs(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u) {
  for (int v : son[u]) {
    ans[v] = ans[u] + (sz[u] - sz[v] - 1) / 2.0 + 1;
    dfs2(v);
  }
}
int main() {
  int n;
  cin >> n;
  int x;
  for (int i = 1; i <= n - 1; ++i) {
    scanf("%d", &x);
    son[x].push_back(i + 1);
  }
  dfs(1);
  ans[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; ++i) printf("%.1lf ", ans[i]);
  return 0;
}
