#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, lim = 1e5 + 10;
int par[lim], sz[lim];
vector<int> ch[lim];
double ans[lim];
inline void bfs1(int ver) {
  sz[ver] = 1;
  for (int x : ch[ver]) {
    bfs1(x);
    sz[ver] += sz[x];
  }
}
inline void bfs(int ver) {
  for (int x : ch[ver]) {
    ans[x] = ans[ver] + 1 + (sz[ver] - sz[x] - 1.0) / 2;
    bfs(x);
  }
}
int main() {
  int n;
  cin >> n;
  int t;
  for (int i = 0, _n = (n - 1); i < _n; i++)
    cin >> t, ch[t - 1].emplace_back(i + 1);
  ch[n].emplace_back(0);
  bfs1(n);
  bfs(n);
  for (int i = 0, _n = (n); i < _n; i++)
    cout << fixed << setprecision(1) << ans[i] << " \n"[i == n - 1];
  return 0;
}
