#include <bits/stdc++.h>
using namespace std;
const int MAXN = 111111;
vector<int> E[MAXN];
double P[MAXN];
double dp[MAXN];
int size[MAXN];
int counter[MAXN];
void dfs(int node) {
  size[node] = 1;
  for (int i = 0; i < E[node].size(); i++) {
    int to = E[node][i];
    dfs(to);
    size[node] += size[to];
  }
}
void dfs_solve(int node, int dad = -1) {
  if (node == 1) dp[1] = 1.0;
  int sum = 0;
  for (int i = 0; i < E[node].size(); i++) {
    int to = E[node][i];
    sum += size[to];
  }
  for (int i = 0; i < E[node].size(); i++) {
    int to = E[node][i];
    dp[to] = 1.0 + dp[node];
    dp[to] += (sum - size[to]) / 2.0;
    dfs_solve(to, node);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int dad;
    cin >> dad;
    E[dad].push_back(i);
  }
  dfs(1);
  dfs_solve(1);
  printf("1.0");
  for (int i = 2; i <= n; i++) {
    printf(" %.10lf", dp[i]);
  }
  return 0;
}
