#include <bits/stdc++.h>
using namespace std;
vector<int> children[100005];
int n, p, sz[100005];
double result[100005];
int calc_sz(int node) {
  sz[node] = 1;
  for (int i = 0; i < children[node].size(); ++i)
    sz[node] += calc_sz(children[node][i]);
  return sz[node];
}
void solve(int node, int p_sz, double p_exp) {
  result[node] = p_exp + 1 + (p_sz - sz[node] - 1) * 0.5;
  for (int i = 0; i < children[node].size(); ++i)
    solve(children[node][i], sz[node], result[node]);
}
int main(void) {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &p);
    children[p].push_back(i);
  }
  calc_sz(1);
  solve(1, n + 1, 0);
  for (int i = 1; i <= n; ++i) printf("%lf ", result[i]);
  printf("\n");
  return 0;
}
