#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> childs[100001];
int sz[100001];
double ex[100001];
void dfs1(int x) {
  sz[x] = 1;
  for (int y : childs[x]) {
    dfs1(y);
    sz[x] += sz[y];
  }
}
void dfs2(int x, int p) {
  double t = sz[p] - 1 - sz[x];
  ex[x] = 1.0 + ex[p] + t / 2;
  for (int y : childs[x]) {
    dfs2(y, x);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int t;
    scanf("%d", &t);
    childs[t].push_back(i);
  }
  dfs1(1);
  ex[0] = 0;
  sz[0] = sz[1] + 1;
  dfs2(1, 0);
  for (int i = 1; i <= n; i++) {
    printf("%.7f ", ex[i]);
  }
}
