#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> G[N];
int n, sz[N];
double f[N];
void dfs(int u) {
  sz[u] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    dfs(G[u][i]);
    sz[u] += sz[G[u][i]];
  }
}
void dfs1(int u) {
  int tot = 0;
  for (int i = 0; i < G[u].size(); i++) {
    tot += sz[G[u][i]];
  }
  for (int i = 0; i < G[u].size(); i++) {
    f[G[u][i]] = 1 + f[u] + (tot - sz[G[u][i]]) * 0.5;
    dfs1(G[u][i]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int f;
    cin >> f;
    G[f].push_back(i);
  }
  dfs(1);
  f[1] = 1.0;
  dfs1(1);
  for (int i = 1; i <= n; i++) {
    cout << f[i] << " ";
  }
  cout << endl;
  return 0;
}
