#include <bits/stdc++.h>
using namespace std;
vector<int> VT[100010];
int f[100010];
int num[100010];
double ans[100010];
void FI(int x) {
  if (f[x] != x) {
    num[f[x]]++;
    FI(f[x]);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  f[1] = 1;
  for (int i = 1; i <= n; i++) {
    VT[i].clear();
  }
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    f[i] = u;
    VT[u].push_back(i);
  }
  memset(num, 0, sizeof num);
  for (int i = n; i >= 1; i--) {
    int SI = VT[i].size();
    for (int j = 0; j < SI; j++) {
      num[i] += num[VT[i][j]] + 1;
    }
  }
  ans[1] = 1.0;
  for (int i = 1; i <= n; i++) {
    int SI = VT[i].size();
    for (int j = 0; j < SI; j++) {
      ans[VT[i][j]] =
          (1.0 * (ans[i] + 1 + ans[i] + num[i] - num[VT[i][j]]) / 2);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i < n)
      printf("%.6f ", ans[i]);
    else
      printf("%.6f\n", ans[i]);
  }
  return 0;
}
