#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 1e5 + 5;
const double esp = 1e-8;
vector<int> vc[N];
int child[N];
double ans[N];
int dfs(int pos) {
  child[pos] = vc[pos].size();
  if (!vc[pos].size()) return child[pos];
  for (int i = 0; i < vc[pos].size(); ++i) child[pos] += dfs(vc[pos][i]);
  return child[pos];
}
void get(int pos) {
  for (int i = 0; i < vc[pos].size(); ++i) {
    ans[vc[pos][i]] =
        ans[pos] + (1.0 * child[pos] - child[vc[pos][i]] - 1) / 2.0 + 1.0;
    get(vc[pos][i]);
  }
}
long long Pow(long long n, int m) {
  long long ans = 1;
  while (m) {
    if (m & 1) ans *= n;
    n *= n;
    m >>= 1;
  }
  return ans;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) vc[i].clear();
    for (int i = 2; i <= n; ++i) {
      int x;
      scanf("%d", &x);
      vc[x].push_back(i);
    }
    dfs(1);
    ans[1] = 1.0;
    get(1);
    for (int i = 1; i <= n; ++i) {
      if (i > 1) printf(" ");
      printf("%.8f", ans[i]);
    }
    printf("\n");
  }
  return 0;
}
