#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
struct son {
  int v, next;
};
son a1[N << 1];
int first[N << 1], e;
void addbian(int u, int v) {
  a1[e].v = v;
  a1[e].next = first[u];
  first[u] = e++;
}
int n;
int u, o, p;
double f[N];
int size[N];
void dfs(int x) {
  size[x] = 1;
  for (int i = first[x]; i != -1; i = a1[i].next) {
    int temp = a1[i].v;
    dfs(temp);
    size[x] += size[temp];
  }
}
void dp(int x) {
  for (int i = first[x]; i != -1; i = a1[i].next) {
    int temp = a1[i].v;
    f[temp] = f[x] + (double)(size[x] - size[temp] - 1) / 2.0 + 1.0;
    dp(temp);
  }
}
int main() {
  memset(first, -1, sizeof(first));
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &u);
    addbian(u, i);
  }
  dfs(1);
  f[1] = 1.0;
  dp(1);
  for (int i = 1; i <= n; ++i) printf("%.1lf ", f[i]);
  return 0;
  ;
}
