#include <bits/stdc++.h>
using namespace std;
vector<int> G[100010];
long double dp[100010];
int cn[100010];
long double inv[100010];
int dfs1(int n, int p) {
  int sum = 1;
  for (int c : G[n]) {
    if (c != p) sum += dfs1(c, n);
  }
  cn[n] = sum;
  return sum;
}
void dfs2(int n, int p, long double e) {
  dp[n] = e + 1.0;
  int children = G[n].size() - 1;
  if (p == -1) children++;
  for (int c : G[n]) {
    if (c != p) {
      long double ee = dp[n];
      ee += (cn[n] - 1 - cn[c]) * 0.5;
      dfs2(c, n, ee);
    }
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  inv[1] = 1.0;
  for (int i = 2; i < 100010; i++) {
    inv[i] = inv[i - 1] + 1.0 / i;
  }
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int m;
    cin >> m;
    G[i].push_back(m);
    G[m].push_back(i);
  }
  dfs1(1, -1);
  dfs2(1, -1, 0.0);
  for (int i = 1; i <= n; i++) {
    cout << dp[i];
    if (i != n) cout << " ";
  }
  cout << endl;
}
