#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const int N = 100005;
vector<int> g[N];
double dp[N];
int s[N];
void dfs1(int v, int pr = -1) {
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to == pr) {
      continue;
    }
    dfs1(to, v);
    s[v] += s[to];
  }
  s[v]++;
}
void dfs2(int v, int pr = -1) {
  double p = g[v].size() - 1;
  if (pr == -1) {
    p += 2;
    dp[v] = 1;
  }
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to == pr) {
      continue;
    }
    dp[to] = (dp[v] + 1 + (1. / 4) * ((s[v] - 1) * 2 - (s[to]) * 2));
    dfs2(to, v);
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int q;
    cin >> q;
    g[q].push_back(i);
    g[i].push_back(q);
  }
  dfs1(1);
  dfs2(1);
  cout.precision(9);
  for (int i = 1; i <= n; i++) {
    cout << fixed << dp[i] << " ";
  }
}
