#include <bits/stdc++.h>
using namespace std;
using namespace placeholders;
template <typename T>
T sum(initializer_list<T>&& l) {
  return accumulate(l.begin(), l.end(), T(0));
}
const int N = 2e5;
const int M = N << 1;
double ans[N];
int n;
int sz[N], seen[N];
int ad[N];
int to[M], nx[M], es = 2;
int count(int i) {
  sz[i] = 1;
  for (int e = ad[i]; e; e = nx[e])
    if (!sz[to[e]]) sz[i] += count(to[e]);
  return sz[i];
}
void dfs(int i, double s) {
  seen[i] = 1;
  ans[i] = s;
  for (int e = ad[i]; e; e = nx[e])
    if (!seen[to[e]]) dfs(to[e], s + .5 * (sz[i] - sz[to[e]] + 1));
}
int main() {
  scanf(" %d", &n);
  for (int j = 1; j < n; j++) {
    int i;
    scanf(" %d", &i);
    i--;
    to[es] = j;
    nx[es] = ad[i];
    ad[i] = es++;
    to[es] = i;
    nx[es] = ad[j];
    ad[j] = es++;
  }
  count(0);
  dfs(0, 1);
  for (int i = 0; i < n; i++) printf("%.7lf%c", ans[i], " \n"[i + 1 == n]);
}
