#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> child[100001];
double ans[100001];
int sz[100001];
void dfs1(int v) {
  sz[v] = 1;
  for (auto ch : child[v]) {
    dfs1(ch);
    sz[v] += sz[ch];
  }
}
void dfs2(int v) {
  int s = 0;
  for (auto ch : child[v]) s += sz[ch];
  for (auto ch : child[v]) {
    int s1 = s - sz[ch];
    ans[ch] = ans[v] + (double)s1 / 2 + 1;
    dfs2(ch);
  }
}
int main(int argc, char **argv) {
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    int p;
    scanf("%d", &p);
    child[p].push_back(i);
  }
  dfs1(1);
  ans[1] = 1;
  dfs2(1);
  for (int i = 1; i <= N; i++) printf("%0.8f ", ans[i]);
  printf("\n");
  return 0;
}
