#include <bits/stdc++.h>
using namespace std;
int p[100005];
vector<int> adj[100005];
int sz[100005];
int d[100005];
void dfs(int v) {
  sz[v] = 1;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    d[u] = d[v] + 1;
    dfs(u);
    sz[v] += sz[u];
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    adj[p[i]].push_back(i);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    int ans = n - sz[i] - d[i];
    cout << ans / 2 + d[i] + 1 << ".";
    if (ans & 1) {
      cout << "5 ";
    } else {
      cout << "0 ";
    }
  }
  cout << endl;
  return 0;
}
