#include <bits/stdc++.h>
using namespace std;
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...);
}
const long long oo = INT_MAX;
const long long MOD = 1e9 + 7;
const long long sz = 1e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tc = 1;
  while (tc--) {
    long long n;
    cin >> n;
    vector<long long> tree[n + 1];
    for (long long i = 2; i < n + 1; ++i) {
      long long p;
      cin >> p;
      tree[i].push_back(p);
      tree[p].push_back(i);
    }
    vector<long long> nodeCnt(n + 1, 0);
    vector<double> startTime(n + 1, 0.0);
    startTime[1] = 1.0;
    function<long long(long long, long long)> dfs1 = [&](long long node,
                                                         long long parent) {
      long long cnt = 1;
      for (auto child : tree[node]) {
        if (child != parent) {
          cnt += dfs1(child, node);
        }
      }
      nodeCnt[node] = cnt;
      return cnt;
    };
    function<void(long long, long long)> dfs2 = [&](long long node,
                                                    long long parent) {
      long long ncnt = nodeCnt[node] - 1, cnt = 0;
      for (auto child : tree[node]) {
        if (child != parent) {
          startTime[child] =
              ((ncnt - nodeCnt[child]) * 1.0) / 2 + (1.0 + startTime[node]);
          dfs2(child, node);
        }
      }
    };
    dfs1(1, 0);
    dfs2(1, 0);
    for (long long i = 1; i < n + 1; ++i)
      cout << fixed << setprecision(1) << startTime[i] << " ";
  }
}
