#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const long long inf = 1LL << 30;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const int N = 100100;
vector<int> adj[N];
int sz[N];
double dp[N];
void DFS2(int u) {
  sz[u] = 1;
  for (auto v : adj[u]) {
    DFS2(v);
    sz[u] += sz[v];
  }
}
void DFS(int u) {
  for (auto v : adj[u]) {
    double y = sz[u] - sz[v] - 1;
    dp[v] = dp[u] + (y / 2.0) + 1;
    DFS(v);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    adj[x].push_back(i);
  }
  DFS2(1);
  dp[1] = 1.0;
  DFS(1);
  for (int i = 1; i <= n; i++) printf("%.1f ", dp[i]);
}
