#include <bits/stdc++.h>
using namespace std;
double ans[100002];
int n, fa[100002], children[100002], head[100002], amount[100002], cnt;
struct xint {
  int to, next;
} e[100002];
void addedge(int x, int y) {
  e[++cnt].to = y;
  e[cnt].next = head[x];
  head[x] = cnt;
}
void dfs(int x) {
  amount[x] = 1;
  for (int i = head[x]; i; i = e[i].next) {
    int y = e[i].to;
    dfs(y);
    amount[x] += amount[y];
    children[x]++;
  }
}
void dfs1(int fa, int x) {
  int sum = amount[fa] - 1 - amount[x];
  ans[x] = double(sum) / 2 + ans[fa] + 1;
  for (int i = head[x]; i; i = e[i].next) {
    int y = e[i].to;
    dfs1(x, y);
  }
  ans[x] += 1;
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> fa[i];
    addedge(fa[i], i);
  }
  dfs(1);
  amount[0] = amount[1] + 1;
  dfs1(0, 1);
  for (int i = 1; i <= n; i++)
    printf("%.1lf%c", ans[i] - 1, i < n ? ' ' : '\n');
}
