#include <bits/stdc++.h>
using namespace std;
const long long UNDEF = -1;
template <typename T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
template <typename T>
inline bool chkmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
const long long MAXN = 1e5 + 8;
vector<long long> g[MAXN];
long long sz[MAXN];
long long ch[MAXN];
long long getsz(long long x, long long p) {
  long long ans = 1;
  long long child = 0;
  for (auto &w : g[x]) {
    ans += getsz(w, x);
    child++;
  }
  ch[x] = child;
  sz[x] = ans;
  return ans;
}
long double f[MAXN];
void getf(long long x, long long p) {
  if (x == 1) {
    f[x] = 1;
  } else {
    long double sumsz = sz[p] - sz[x] - 1;
    long long chp = ch[p];
    assert(chp > 0);
    long double ans = 1 + f[p] + (sumsz) / 2;
    f[x] = ans;
  }
  for (auto &w : g[x]) {
    getf(w, x);
  }
}
int main() {
  int _n;
  scanf("%d", &_n);
  long long n = _n;
  for (long long x = 2; x <= n; x++) {
    int _y;
    scanf("%d", &_y);
    long long y = _y;
    g[y].push_back(x);
  }
  getsz(1, -1);
  getf(1, -1);
  for (long long x = 1; x <= n; x++) {
    printf("%.8f ", (double)f[x]);
  }
  printf("\n");
}
