#include <bits/stdc++.h>
using namespace std;
const int N = 100007, mod = 1000000007, inf = 1000000007;
const long long lmod = 1000000007, linf = 1e18 + 77;
const long double eps = 1e-9;
vector<int> g[N];
int sum[N];
int h[N];
void dfs(int v, int depth) {
  h[v] = depth;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    dfs(to, depth + 1);
    sum[v] += sum[to];
  }
  sum[v]++;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  scanf("%d", &n);
  ;
  for (int i = 0; i < n - 1; i++) {
    int x;
    scanf("%d", &x);
    ;
    x--;
    g[x].push_back(i + 1);
  }
  dfs(0, 1);
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << fixed << setprecision(1)
         << h[i] + ((long double)n - sum[i] - h[i] + 1) / 2;
  }
  cout << endl;
}
