#include <bits/stdc++.h>
using namespace std;
int n, p, sz[123456];
vector<int> al[123456];
double ans[123456];
void s(int at) {
  sz[at] = 1;
  for (int to : al[at]) s(to), sz[at] += sz[to];
}
void go(int at, double cur) {
  ans[at] = cur;
  cur += 1;
  for (int to : al[at]) cur += sz[to] / 2.0;
  for (int to : al[at]) go(to, cur - sz[to] / 2.0);
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i < (n); i++) scanf("%d", &p), al[p - 1].push_back(i);
  s(0);
  go(0, 1);
  for (int i = (0); i < (n); i++)
    printf("%.9lf%c", ans[i], i == n - 1 ? '\n' : ' ');
  return 0;
}
