#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> adj;
vector<long long> visited, node;
vector<double> ans;
long long dfs(long long s) {
  visited[s] = 1;
  long long sum = 1;
  for (long long i = 0; i < adj[s].size(); i++) {
    if (!visited[adj[s][i]]) sum += dfs(adj[s][i]);
  }
  node[s] = sum;
  return sum;
}
void final(long long s, long long sum, long long parent) {
  visited[s] = 1;
  long long d = 0, c = 0;
  for (long long i = 0; i < adj[s].size(); i++) {
    if (!visited[adj[s][i]]) {
      d += node[adj[s][i]];
      c++;
    }
  }
  if (parent == -1)
    ans[s] = 1 + (sum - node[s]) * 1.0 / (2 * 1.0);
  else
    ans[s] = ans[parent] + 1 + (sum - node[s]) * 1.0 / (2 * 1.0);
  for (long long i = 0; i < adj[s].size(); i++) {
    if (!visited[adj[s][i]]) final(adj[s][i], d, s);
  }
  return;
}
void solve() {
  long long n;
  cin >> n;
  visited.resize(n + 1);
  adj.resize(n + 1);
  node.resize(n + 1);
  ans.resize(n + 1);
  for (long long i = 1; i <= n; i++) visited[i] = 0;
  long long a[n];
  for (long long i = 0; i < n - 1; i++) {
    cin >> a[i];
    adj[i + 2].push_back(a[i]);
    adj[a[i]].push_back(i + 2);
  }
  dfs(1);
  for (long long i = 1; i <= n; i++) visited[i] = 0;
  final(1, node[1], -1);
  for (long long i = 1; i <= n; i++)
    cout << fixed << setprecision(12) << ans[i] << " ";
  cout << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
