#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> graph[N];
bool used[N], used2[N];
int sz[N];
double ans[N];
int dfs(int v) {
  int u;
  sz[v] = 1;
  used[v] = true;
  for (int i = 0; i < graph[v].size(); i++) {
    u = graph[v][i];
    if (!used[u]) sz[v] += dfs(u);
  }
  return sz[v];
}
void dfsA(int v, int mn, int mx) {
  int u;
  ans[v] = (mn + mx) / 2.0;
  used2[v] = true;
  for (int i = 0; i < graph[v].size(); i++) {
    u = graph[v][i];
    if (!used2[u]) dfsA(u, mn + 1, mx + (sz[v] - sz[u]));
  }
}
int n, x;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d ", &x);
    graph[x].push_back(i + 2);
  }
  dfs(1);
  dfsA(1, 1, 1);
  for (int i = 0; i < n; i++) printf("%.1lf ", ans[i + 1]);
  return 0;
}
