#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
vector<vector<int>> graph;
int child[N];
int level[N];
int dfs(int s) {
  int ret = 0;
  for (int i = 0; i < (int)graph[s].size(); i++) {
    int v = graph[s][i];
    level[v] = 1 + level[s];
    ret += 1 + dfs(v);
  }
  return child[s] = ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  graph.clear();
  graph.resize(n);
  for (int i = 1; i < n; i++) {
    int x;
    cin >> x;
    x--;
    graph[x].push_back(i);
  }
  level[0] = 1;
  dfs(0);
  double ans;
  for (int i = 0; i < n; i++) {
    ans = (level[i] + n - child[i]) / 2.0;
    cout << fixed << setprecision(1) << ans << " ";
  }
  return 0;
}
