#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e9 + 7;
long long int n, i, j, k, m;
vector<vector<long long int> > adj;
vector<long long int> subs;
vector<double> res;
void pre() { return; }
void dfs(long long int u) {
  long long int temp = 1;
  for (auto v : adj[u]) {
    dfs(v);
    temp += subs[v];
  }
  subs[u] = temp;
}
void dfs2(long long int u) {
  for (auto v : adj[u]) {
    res[v] = ((double)(subs[u] - subs[v] + 1)) / 2.0 + res[u];
    dfs2(v);
  }
}
void solve() {
  cin >> n;
  adj.resize(n + 1);
  subs.resize(n + 1, 0);
  for (long long int i = 0; i < n - 1; i++) {
    cin >> k;
    adj[k].emplace_back(i + 2);
  }
  subs[0] = 0;
  dfs(1);
  res.resize(n + 1);
  res[1] = 1.0;
  dfs2(1);
  cout << fixed << setprecision(10);
  for (i = 1; i <= n; i++) cout << res[i] << ' ';
  cout << '\n';
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pre();
  solve();
  return 0;
}
