#include <bits/stdc++.h>
using namespace std;
map<long long, vector<long long> > adj;
long long c[100005];
double avg[100005];
void dfs(long long x) {
  double cur = avg[x];
  double sum = c[x];
  for (vector<long long>::iterator it = adj[x].begin(); it != adj[x].end();
       ++it) {
    double add = sum - c[*it] - 1;
    add /= 2.0;
    avg[*it] = cur + add + 1;
    dfs(*it);
  }
}
int main() {
  long long n, pi;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    cin >> pi;
    adj[pi].push_back(i);
    c[pi]++;
  }
  for (long long i = n; i >= 1; i--) {
    vector<long long> children = adj[i];
    for (vector<long long>::iterator it = children.begin();
         it != children.end(); ++it) {
      c[i] += c[*it];
    }
  }
  avg[1] = 1.0;
  dfs(1);
  for (long long i = 1; i <= n; ++i) {
    cout << avg[i] << " ";
  }
  return 0;
}
