#include <bits/stdc++.h>
using namespace std;
const int MAX = 1E5 + 10;
int n;
vector<int> g[MAX];
int child[MAX], h[MAX];
void dfs(int u, int p) {
  child[u] = 1;
  for (auto v : g[u])
    if (v != p) {
      h[v] = h[u] + 1;
      dfs(v, u);
      child[u] += child[v];
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x;
    scanf("%d", &x);
    x--;
    g[i].push_back(x);
    g[x].push_back(i);
  }
  dfs(0, -1);
  for (int i = 0; i < n; i++) {
    double ans = (n - child[i] - h[i]) * 1.0 / 2 + h[i] + 1;
    printf("%.1f ", ans);
  }
}
