#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, scale[maxn];
double t[maxn];
vector<int> e[maxn];
void dfs1(int pos) {
  scale[pos] = 1;
  for (int i = 0; i < e[pos].size(); i++) {
    int next = e[pos][i];
    dfs1(next);
    scale[pos] += scale[next];
  }
}
void dfs2(int pos) {
  for (int i = 0; i < e[pos].size(); i++) {
    int next = e[pos][i];
    t[next] = t[pos] + 1 + (scale[pos] - 1 - scale[next]) / 2.0;
    dfs2(next);
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int fa;
    cin >> fa;
    e[fa].push_back(i);
  }
  dfs1(1);
  t[1] = 1.0;
  dfs2(1);
  for (int i = 1; i <= n; i++) printf("%.1f ", t[i]);
  return 0;
}
