#include <bits/stdc++.h>
using namespace std;
const int size1 = 3e5;
const int INF = 2e9;
static bool used[size1], used1[size1];
static int len[size1], der[size1];
static double time1[size1];
vector<vector<int> > graph(size1);
void dfs(int v) {
  used[v] = true;
  for (int i = 0; i < len[v]; i++) {
    if (!used[graph[v][i]]) {
      dfs(graph[v][i]);
      der[v] += der[graph[v][i]];
    }
  }
  der[v]++;
}
void dfs1(int v) {
  used1[v] = true;
  int sum = der[v];
  for (int i = 0; i < len[v]; i++) {
    if (!used1[graph[v][i]]) {
      time1[graph[v][i]] =
          time1[v] + (double(der[v] - der[graph[v][i]] - 1)) / 2 + 1;
      dfs1(graph[v][i]);
    }
  }
}
int main() {
  int n, i;
  cin >> n;
  for (i = 2; i <= n; i++) {
    int v;
    cin >> v;
    graph[i].push_back(v);
    graph[v].push_back(i);
    len[v]++;
    len[i]++;
  }
  dfs(1);
  time1[1] = 1;
  dfs1(1);
  for (i = 1; i <= n; i++) {
    cout << time1[i] << ' ';
  }
  return 0;
}
