#include <bits/stdc++.h>
using namespace std;
int sz[100001], dep[100001], n;
double ans[100001];
vector<int> P[100001];
void dfs(int x) {
  sz[x] = 1;
  for (int i = 0; i < P[x].size(); i++) {
    int y = P[x][i];
    dep[y] = dep[x] + 1;
    dfs(y);
    sz[x] += sz[y];
  }
  ans[x] = (dep[x] + n - sz[x] + 1) / 2.0;
}
int main() {
  scanf("%d", &n);
  for (int a, i = 2; i <= n; i++) {
    scanf("%d", &a);
    P[a].push_back(i);
  }
  dep[1] = 1;
  dfs(1);
  for (int i = 1; i <= n; i++) printf("%.7lf ", ans[i]);
  return 0;
}
