#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int mod = 1e9 + 7;
int sub[100003];
vector<int> g[100003];
long double ans[100003];
void dfs(int i) {
  sub[i] = 1;
  for (auto it : g[i]) {
    dfs(it);
    sub[i] += sub[it];
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int i, j, p[n + 1];
  for (i = 2; i <= n; ++i) cin >> p[i], g[p[i]].push_back(i);
  dfs(1);
  ans[1] = 1.0;
  for (i = 2; i <= n; ++i)
    ans[i] = ans[p[i]] + 1.0 + ((sub[p[i]] - 1 - sub[i]) * 1.0) / 2.0;
  for (i = 1; i <= n; ++i) cout << fixed << setprecision(8) << ans[i] << ' ';
  return 0;
}
