#include <bits/stdc++.h>
using namespace std;
const int MAX_SIZE = 100005;
int n, l[MAX_SIZE];
vector<int> children[MAX_SIZE];
int size[MAX_SIZE];
double st[MAX_SIZE];
int dfs(int v) {
  size[v] = 1;
  for (int i = 0; i < children[v].size(); i++) size[v] += dfs(children[v][i]);
  return size[v];
}
inline double avg(int v, int par) {
  if (children[par].size() == 1) return 0;
  return ((double)size[par] - 1 - size[v]) / (children[par].size() - 1);
}
void calc(int v, int par, double p_st) {
  int nc = children[par].size();
  double av = avg(v, par);
  st[v] = (p_st + 1) + (av * (nc - 1)) / 2;
  for (int i = 0; i < children[v].size(); i++) calc(children[v][i], v, st[v]);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &l[i]);
    children[l[i]].push_back(i + 2);
  }
  dfs(1);
  st[1] = 1;
  for (int i = 0; i < children[1].size(); i++) {
    calc(children[1][i], 1, 1);
  }
  for (int i = 1; i <= n; i++) {
    printf("%lf ", st[i]);
    if (i < n)
      printf(" ");
    else
      printf("\n");
  }
}
