#include <bits/stdc++.h>
using namespace std;
vector<int> tr[100005];
int sz[100005];
int p[100005];
double start[100005];
int S(int i, int par) {
  sz[i] = 1;
  p[i] = par;
  for (int j = 0; j < tr[i].size(); j++) {
    if (tr[i][j] == par) continue;
    sz[i] += S(tr[i][j], i);
  }
  return sz[i];
}
void dfs(int i, double st) {
  start[i] = st + 1;
  double sm = 0;
  for (int j = 0; j < tr[i].size(); j++) {
    if (tr[i][j] == p[i]) continue;
    sm += 0.5 * sz[tr[i][j]];
  }
  for (int j = 0; j < tr[i].size(); j++) {
    if (tr[i][j] == p[i]) continue;
    dfs(tr[i][j], start[i] + sm - 0.5 * sz[tr[i][j]]);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d", &u);
    u--;
    v = i + 1;
    v--;
    tr[u].push_back(v);
    tr[v].push_back(u);
  }
  memset(sz, 0, sizeof(sz));
  S(0, -1);
  dfs(0, 0.0);
  for (int i = 0; i < n; i++) printf("%.9lf\n", start[i]);
}
