#include <bits/stdc++.h>
using namespace std;
long long i, j, p, d, n, m, total, k, ok, a, b, c, op, maxi, rasp, m1, m2, p1,
    p2, rez, modu = 1000000007, mini, mij, ls, ld, t, ul, now, first;
vector<int> v[200005];
double ex[200005];
int si[200005];
string s;
void go(int nod) {
  si[nod]++;
  for (int i = 0; i < v[nod].size(); i++) {
    go(v[nod][i]);
    si[nod] += si[v[nod][i]];
  }
}
void solve(int nod) {
  for (int i = 0; i < v[nod].size(); i++) {
    ex[v[nod][i]] = ex[nod] * 1.0 + (si[nod] - si[v[nod][i]] - 1) / 2.0 + 1;
    solve(v[nod][i]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (i = 2; i <= n; i++) {
    cin >> a;
    v[a].push_back(i);
  }
  go(1);
  ex[1] = 1;
  solve(1);
  cout << fixed;
  cout << setprecision(6);
  for (i = 1; i <= n; i++) cout << ex[i] << " ";
  return 0;
}
