#include <bits/stdc++.h>
using namespace std;
int n, sub_size[100001];
double d[100001];
vector<vector<int>> v;
int pre(int x) {
  int& ret = sub_size[x];
  ret = 1;
  for (auto& c : v[x]) ret += pre(c);
  return ret;
}
void go() {
  d[1] = 1;
  queue<int> q;
  for (q.push(1); !q.empty();) {
    for (int s = q.size(); s--;) {
      int u = q.front();
      q.pop();
      int sub_sum = 0;
      for (auto& c : v[u]) sub_sum += sub_size[c];
      for (auto& c : v[u]) {
        d[c] += (sub_sum - sub_size[c]) * 1. / 2;
        d[c] += (d[u] + 1);
        q.push(c);
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  v.resize(n + 1);
  for (int i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    v[p].emplace_back(i);
  }
  pre(1);
  go();
  for (int i = 1; i <= n; i++) printf("%.10f ", d[i]);
  return 0;
}
