#include <bits/stdc++.h>
using namespace std;
struct edge {
  int x, y, next;
};
edge v[100005];
double ans[100005];
int sum[100005];
int f[100005];
int head[100005];
int n;
int tot = 0;
void add(int x, int y) {
  tot++;
  v[tot].x = x;
  v[tot].y = y;
  v[tot].next = head[x];
  head[x] = tot;
}
void dfs(int now) {
  sum[now]++;
  for (int x = head[now]; x; x = v[x].next) {
    dfs(v[x].y);
    sum[now] += sum[v[x].y];
  }
}
void get(int now) {
  if (now == 1) {
    ans[now] = 1.0;
    return;
  }
  int last = f[now];
  if (ans[last] == 0) {
    get(last);
  }
  ans[now] = 1 + ans[last] + 1.0 * (sum[last] - sum[now] - 1) / 2;
}
int main() {
  memset(ans, 0, sizeof(ans));
  memset(sum, 0, sizeof(sum));
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> f[i];
    add(f[i], i);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (ans[i] == 0) {
      get(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
