#include <bits/stdc++.h>
using namespace std;
long long int n;
long long child[100005];
double ans[100005];
vector<int> G[100005];
int child_update(int node, int pr) {
  long long ans = 1;
  for (int i = 0; i < (int)G[node].size(); i++) {
    if (G[node][i] == pr) continue;
    ans += child_update(G[node][i], node);
  }
  return child[node] = ans;
}
void dfs(int n, int pr) {
  for (int i = 0; i < (int)G[n].size(); i++) {
    if (G[n][i] == pr) continue;
    int u = G[n][i];
    int v = child[n] - child[u] - 1;
    ans[u] = ans[n] + 1.0 + double(v) / 2.0;
    dfs(u, n);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  ans[1] = 1.0;
  for (int i = 2; i <= n; i++) {
    long long a;
    cin >> a;
    G[a].push_back(i);
  }
  child_update(1, -1);
  dfs(1, -1);
  for (int i = 1; i <= n; i++) {
    cout << ((i > 1) ? " " : "") << fixed << setprecision(9) << ans[i];
  }
  cout << "\n";
  return 0;
}
