#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
vector<int> adj[N];
int d[N];
double ans[N];
void DFS1(int v, int par) {
  for (int u : adj[v])
    if (u != par) {
      DFS1(u, v);
      d[v] += d[u];
    }
  d[v]++;
  return;
}
void DFS2(int v, int par) {
  double tmp(0);
  for (int u : adj[v])
    if (u != par) {
      ans[u] = ans[v] + 1 + tmp / 2;
      tmp += d[u];
    }
  tmp = 0;
  for (int i = (int)adj[v].size() - 1; i >= 0; i--) {
    int u = adj[v][i];
    if (u != par) {
      ans[u] += tmp / 2;
      tmp += d[u];
      DFS2(u, v);
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, u;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u;
    adj[i].push_back(--u);
    adj[u].push_back(i);
  }
  DFS1(0, 0);
  ans[0] = 1;
  DFS2(0, 0);
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
