#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
vector<int> g[100100];
double res[100100];
int d[100100];
void dfs1(int x) {
  d[x] = 1;
  for (int i = (0); i < ((int)g[x].size()); i++) {
    dfs1(g[x][i]);
    d[x] += d[g[x][i]];
  }
}
void dfs(int x, double b) {
  int s = d[x] - 1;
  for (int i = (0); i < ((int)g[x].size()); i++) {
    int to = g[x][i];
    s -= d[to];
    res[to] = b + 1 + s / 2.0;
    dfs(to, res[to]);
    s += d[to];
  }
}
int main(int argc, char* argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = (1); i < (n); i++) {
    int x;
    scanf("%d", &x);
    x--;
    g[x].push_back(i);
  }
  dfs1(0);
  res[0] = 1;
  dfs(0, 1);
  for (int i = (0); i < (n); i++) {
    printf("%.9f ", res[i]);
  }
  printf("\n");
}
