#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
int n;
int par[100005];
int d[100005];
double res[100005];
void dfs(int x) {
  d[x] = 1;
  for (auto u : v[x]) {
    dfs(u);
    d[x] += d[u];
  }
}
void dfs2(int x, int pre = 0) {
  res[x] = res[pre] + (double)(d[pre] - d[x] - 1) / 2.0 + 1;
  for (auto u : v[x]) {
    dfs2(u, x);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> par[i];
    v[par[i]].push_back(i);
  }
  dfs(1);
  d[0] = d[1] + 1;
  dfs2(1);
  for (int i = 1; i <= n; i++) {
    cout << setprecision(15) << res[i] << ' ';
  }
  cout << '\n';
}
