#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e12;
const int MAXN = 2 * 1e5 + 1, MODM = 1e9 + 7, P = 1e6 + 3, MULT1 = 30,
          MULT2 = 239, LUCKY = 13, ELEVEN = 11, MAXM = 101;
vector<int> g[MAXN];
int dp[MAXN];
long double ans[MAXN];
long double fact[MAXN];
void dfs(int v, int p = -1) {
  int ans = 1;
  for (auto to : g[v]) {
    if (to == p) continue;
    dfs(to, v);
    ans += dp[to];
  }
  dp[v] = ans;
}
void dfs1(int v, int p = -1) {
  if (v != 1) {
    ans[v] = (ans[p] + 1.0) + (1.0 * dp[p] - 1 - dp[v]) / 2.0;
  }
  for (auto to : g[v]) {
    if (to == p) continue;
    dfs1(to, v);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x;
    cin >> x;
    g[x].push_back(i + 2);
  }
  dfs(1);
  cout << fixed << setprecision(6);
  ans[1] = 1.0;
  fact[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    fact[i] = fact[i - 1] + fact[i - 1] / (i * 1.0);
  }
  dfs1(1);
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
