#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int sz[MAXN + 1];
vector<int> g[MAXN + 1];
long double dp[MAXN + 1];
void dfs(int v) {
  sz[v]++;
  for (auto u : g[v]) {
    dfs(u);
    sz[v] += sz[u];
  }
}
void dpCalc(int v) {
  for (auto u : g[v]) {
    int cur = sz[v] - 1 - sz[u];
    dp[u] = dp[v] + 1 + cur / 2.0;
    dpCalc(u);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    g[x].push_back(i);
  }
  dfs(1);
  dp[1] = 1.0;
  dpCalc(1);
  for (int i = 1; i <= n; i++) {
    cout << fixed << setprecision(15) << dp[i] << " ";
  }
  return 0;
}
