#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 10;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int n;
struct edge {
  int v, next;
} e[500100];
int head[100100], tot = 0;
void Add(int u, int v) {
  e[tot].v = v;
  e[tot].next = head[u];
  head[u] = tot++;
}
int sz[100100];
void DFS(int u, int fa) {
  sz[u] = 1;
  for (int i = head[u]; i != -1; i = e[i].next) {
    int v = e[i].v;
    if (v == fa) continue;
    DFS(v, u);
    sz[u] += sz[v];
  }
}
double anw[100100];
void DFS1(int u, int fa) {
  for (int i = head[u]; i != -1; i = e[i].next) {
    int v = e[i].v;
    if (v == fa) continue;
    anw[v] = anw[u] + 1.0 + (sz[u] - sz[v] - 1) * 1.0 / 2.0;
    DFS1(v, u);
  }
}
int main() {
  memset(head, -1, sizeof(head));
  while (cin >> n) {
    for (int i = 2; i <= n; i++) {
      int x;
      cin >> x;
      Add(x, i);
      Add(i, x);
    }
    DFS(1, 0);
    anw[1] = 1.0;
    DFS1(1, 0);
    for (int i = 1; i <= n; i++) cout << anw[i] << " ";
    cout << endl;
  }
  return 0;
}
