#include <bits/stdc++.h>
using namespace std;
long double pro[100001] = {0};
vector<long long int> ar[100001];
long long int w[100001] = {0};
void dfs(long long int s, long long int p) {
  w[s] = 1;
  for (auto it : ar[s]) {
    if (it != p) {
      dfs(it, s);
      w[s] += w[it];
    }
  }
}
void df(long long int s, long long int u) {
  for (auto it : ar[s]) {
    if (it != u) {
      pro[it] = pro[s] + (w[s] - w[it] + 1) / 2.00;
      df(it, s);
    }
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int a, b;
  for (int x = 2; x <= n; x++) {
    cin >> b;
    ar[b].push_back(x);
    ar[x].push_back(b);
  }
  pro[1] = 1;
  dfs(1, -1);
  df(1, -1);
  cout << fixed;
  for (int x = 1; x <= n; x++) cout << setprecision(6) << pro[x] << " ";
}
