#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > tree;
vector<long long> szs, answ;
void dfssz(int u, int par) {
  szs[u] = 1;
  for (int v : tree[u])
    if (v != par) {
      dfssz(v, u);
      szs[u] += szs[v];
    }
}
void dfs(int u, long long zeta, int h, int par) {
  answ[u] = 2 + 2 * h + zeta;
  for (int v : tree[u])
    if (v != par) {
      dfs(v, zeta + szs[u] - szs[v] - 1, h + 1, u);
    }
}
int main() {
  int n;
  cin >> n;
  tree.resize(n);
  for (int i = 1; i < n; i++) {
    int par;
    cin >> par;
    par--;
    tree[par].push_back(i);
  }
  szs.resize(n, 0);
  answ.resize(n);
  dfssz(0, -1);
  dfs(0, 0, 0, -1);
  for (int i = 0; i < n; i++) {
    cout << (double)answ[i] / 2 << " ";
  }
  cout << endl;
  return 0;
}
