#include <bits/stdc++.h>
using namespace std;
vector<int> e[100000];
int sz[100000];
double ans[100000];
void dfs(int now) {
  sz[now] = 1;
  for (int i = 0; i < e[now].size(); ++i) {
    int next = e[now][i];
    dfs(next);
    sz[now] += sz[next];
  }
}
void calc(int now) {
  for (int i = 0; i < e[now].size(); ++i) {
    int next = e[now][i];
    ans[next] = ans[now] + 1.0;
    ans[next] += 0.5 * (sz[now] - sz[next] - 1);
    calc(next);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int p;
    scanf("%d", &p);
    p--;
    e[p].push_back(i + 1);
  }
  dfs(0);
  ans[0] = 1.0;
  calc(0);
  for (int i = 0; i < n; ++i) printf("%.10f ", ans[i]);
  cout << endl;
  return 0;
}
