#include <bits/stdc++.h>
using namespace std;
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 = (x * p) % m;
    p = (p * p) % m;
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
T gcd(T a, T b) {
  while (a %= b ^= a ^= b ^= a)
    ;
  return b;
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
vector<long long> g[100005];
long long temp[100005];
double ans[100005];
long long dfs(long long p) {
  temp[p] = 1;
  for (auto c : g[p]) {
    temp[p] += dfs(c);
  }
  return temp[p];
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (__typeof(n) i = 2; i <= n; ++i) {
    long long a;
    cin >> a;
    g[a].push_back(i);
  }
  dfs(1);
  queue<long long> Q;
  Q.push(1);
  ans[1] = 1.0;
  while (!Q.empty()) {
    long long t = Q.front();
    Q.pop();
    double res = 0;
    for (auto c : g[t]) {
      res += temp[c];
    }
    for (auto c : g[t]) {
      ans[c] = 1.0 + ans[t] + (res - (double)temp[c]) / 2;
      Q.push(c);
    }
  }
  for (__typeof(n) i = 1; i <= n; ++i) {
    cout << fixed << setprecision(12) << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
