#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
vector<int> adj[MAXN];
int par[MAXN], t[MAXN];
double ans[MAXN];
void dfs(int v) {
  t[v] = 1;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != par[v]) {
      dfs(u);
      t[v] += t[u];
    }
  }
}
void dfs2(int v) {
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != par[v]) {
      ans[u] = ans[v] + double(t[v] - t[u] + 1) / double(2);
      dfs2(u);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  par[0] = -1;
  for (int i = 1; i < n; i++) {
    cin >> par[i], par[i]--;
    adj[i].push_back(par[i]);
    adj[par[i]].push_back(i);
  }
  dfs(0);
  ans[0] = 1;
  dfs2(0);
  cout.precision(1);
  for (int i = 0; i < n; i++) cout << fixed << ans[i] << " ";
  cout << endl;
  return 0;
}
