#include <bits/stdc++.h>
using namespace std;
long long sigma(long long n) { return (n * (n + 1) / 2); }
long long MOD(long long x) {
  if (x >= 0) return x;
  return (-x);
}
bool great(long long a, long long b) { return a > b; }
bool p_sm(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) {
    return (a.second < b.second);
  }
  return (a.first < b.first);
}
long long max3(long long a, long long b, long long c) {
  return (max(a, max(b, c)));
}
long long max4(long long a, long long b, long long c, long long d) {
  return (max(max(a, b), max(c, d)));
}
long long min3(long long a, long long b, long long c) {
  return (min(a, min(b, c)));
}
long long min4(long long a, long long b, long long c, long long d) {
  return (min(min(a, b), min(c, d)));
}
vector<long long> factors(long long x) {
  vector<long long> v;
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      v.push_back(i);
      if (i != x / i) {
        v.push_back(x / i);
      }
    }
  }
  return v;
}
vector<long long> ispr;
vector<long long> min_prime;
unordered_map<long long, long long> prime_fact(long long x) {
  unordered_map<long long, long long> mp;
  while (x != 1) {
    mp[min_prime[x]]++;
    x /= min_prime[x];
  }
  return mp;
}
map<long long, long long> factorizee(long long n) {
  map<long long, long long> mp;
  for (long long i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      mp[i]++;
      n /= i;
    }
  }
  if (n != 1) {
    mp[n]++;
  }
  return mp;
}
long long power(long long a, long long b, long long m) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2) {
      ans = (ans * a) % m;
    }
    a = (a * a) % m;
    b = b / 2;
  }
  return ans;
}
vector<vector<long long>> dp;
vector<long long> chl;
long long dfs(long long i, long long j) {
  chl[i] = 1;
  if (i != 0) {
    if (dp[i].size() == 1) {
      chl[i] = 1;
      return 1;
    }
  }
  for (int k : dp[i]) {
    if (k != j) {
      chl[i] += dfs(k, i);
    }
  }
  return chl[i];
}
vector<double> ans;
void doer(long long i, long long j) {
  if (i == 0) {
    ans[i] = 1;
  } else {
    ans[i] += 2 * (ans[j] + 1);
    ans[i] += (chl[j] - chl[i] - 1);
    ans[i] /= 2;
  }
  for (int k : dp[i]) {
    if (k != j) {
      doer(k, i);
    }
  }
}
int main() {
  long long n;
  cin >> n;
  dp.resize(n);
  chl.resize(n);
  for (long long i = 1; i < n; i++) {
    long long x;
    cin >> x;
    --x;
    dp[x].push_back(i);
    dp[i].push_back(x);
  }
  ans.resize(n);
  long long xx = dfs(0, 0);
  doer(0, 0);
  for (long long i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
