#include <bits/stdc++.h>
using namespace std;
int d[100050], n, i, x;
double ans[100050];
vector<int> g[100050];
void dfs1(int v) {
  d[v] = 1;
  int siz = g[v].size();
  for (int i = 0; i < siz; i++) {
    dfs1(g[v][i]);
    d[v] += d[g[v][i]];
  }
}
void dfs(int v) {
  int siz = g[v].size();
  for (int i = 0; i < siz; i++) {
    ans[g[v][i]] = ans[v] + 1 + (d[v] * 1.0 - d[g[v][i]] * 1.0 - 1) * 1.0 / 2.0;
    dfs(g[v][i]);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    g[x].push_back(i);
  }
  dfs1(1);
  ans[1] = 1;
  dfs(1);
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
