#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1;
int n, u, dep[MAX], sz[MAX];
float res[MAX];
vector<int> adj[MAX];
void visit(const int& u) {
  sz[u] = 1;
  for (int point : adj[u]) {
    dep[point] = dep[u] + 1;
    visit(point);
    sz[u] += sz[point];
  }
  res[u] = dep[u] + (float)(n - sz[u] - dep[u] + 1) / 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &u);
    adj[u].push_back(i);
  }
  dep[1] = 1;
  visit(1);
  for (int i = 1; i <= n; ++i) printf("%f ", res[i]);
  return 0;
}
