#include <bits/stdc++.h>
using namespace std;
const long long infi = 1000000000000000009;
vector<int> v[100009 + 4];
int n;
int visited[100009 + 4];
double ans[100009 + 4];
int child[100009 + 4];
void DFS1(int start) {
  visited[start] = 1;
  int i, j;
  child[start] = 1;
  for (i = 0; i < v[start].size(); i++) {
    if (visited[v[start][i]] == 0) {
      DFS1(v[start][i]);
      child[start] += child[v[start][i]];
    }
  }
}
void DFS(int start) {
  visited[start] = 1;
  int i, j;
  int c = 0;
  double a = 0.0;
  for (i = 0; i < v[start].size(); i++) {
    if (visited[v[start][i]] == 0) {
      a = a + child[v[start][i]];
      c++;
    }
  }
  for (i = 0; i < v[start].size(); i++) {
    if (visited[v[start][i]] == 0) {
      ans[v[start][i]] = ans[start] + 1 + (a - child[v[start][i]]) / (2.0);
    }
  }
  for (i = 0; i < v[start].size(); i++) {
    if (visited[v[start][i]] == 0) {
      DFS(v[start][i]);
    }
  }
}
int main() {
  int i, j, p;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    scanf("%d", &p);
    v[p].push_back(i);
    v[i].push_back(p);
  }
  ans[1] = 1.0;
  DFS1(1);
  for (i = 1; i <= n; i++) {
    visited[i] = 0;
  }
  DFS(1);
  for (i = 1; i <= n; i++) printf("%0.9lf ", ans[i]);
  return 0;
}
