#include <bits/stdc++.h>
using namespace std;
long long int mulmod(long long int a, long long int b, long long int m) {
  long long int q =
      (long long int)(((long double)a * (long double)b) / (long double)m);
  long long int r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T MOD(T a, T b) {
  return (a < b ? a : a % b);
}
template <typename T>
T expo(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mulmod(x, p, m);
    p = mulmod(p, p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T gcd(T a, T b) {
  if (a % b) return gcd(b, a % b);
  return b;
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
vector<int> G[100005];
int nodes[100005];
double ans[100005];
void getnodes(int ver) {
  nodes[ver] = 1;
  for (auto x : G[ver]) {
    getnodes(x);
    nodes[ver] += nodes[x];
  }
}
void dfs(int ver) {
  for (auto x : G[ver]) {
    ans[x] = 1.0 + ans[ver] + 0.5 * (nodes[ver] - 1 - nodes[x]);
    dfs(x);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, p;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    G[p].push_back(i);
  }
  ans[1] = 1;
  getnodes(1);
  dfs(1);
  cout << fixed << setprecision(10);
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
