#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& num) {
  bool start = false, neg = false;
  char c;
  num = 0;
  while ((c = getchar()) != EOF) {
    if (c == '-')
      start = neg = true;
    else if (c >= '0' && c <= '9') {
      start = true;
      num = num * 10 + c - '0';
    } else if (start)
      break;
  }
  if (neg) num = -num;
}
struct edge {
  int next, to;
};
const int maxn = (int)(1e5) + 5;
int p[maxn];
int fr[maxn];
int siz[maxn];
int cnt[maxn];
edge e[maxn << 1];
double res[maxn];
int n, tote = 0;
inline void addone(int u, int v) {
  ++tote;
  e[tote].next = fr[u];
  fr[u] = tote;
  e[tote].to = v;
}
inline void addedge(int u, int v) {
  addone(u, v);
  addone(v, u);
}
void dfs(int x, int f) {
  siz[x] = 1;
  for (int i = fr[x]; i != -1; i = e[i].next)
    if (e[i].to != f) dfs(e[i].to, x), siz[x] += siz[e[i].to], cnt[x]++;
}
void solve(int x, int f, double v, int k) {
  res[x] = v;
  for (int i = fr[x]; i != -1; i = e[i].next)
    if (e[i].to != f)
      solve(e[i].to, x, v + 1.0 * (k - siz[e[i].to] + 1) / 2, siz[e[i].to]);
}
int main() {
  read(n);
  memset(fr, -1, sizeof(fr));
  for (int i = (2); i <= (n); i++) {
    read(p[i]);
    addedge(p[i], i);
  }
  dfs(1, 0);
  solve(1, 0, 1, n);
  for (int i = (1); i <= (n); i++) printf("%.8lf ", res[i]);
  putchar('\n');
  return 0;
}
