#include <bits/stdc++.h>
using namespace std;
std::vector<int> arr[100005];
long sum[100005], N, x, parent[100005];
float ans[100005];
int pre(int i) {
  int n = 1;
  if (!arr[i].size()) {
    sum[i] = 1;
    return n;
  }
  for (auto j : arr[i]) n += pre(j);
  sum[i] = n;
  return n;
}
void calc(int i) {
  if (i == 1)
    ans[i] = 1.0;
  else
    ans[i] = ans[parent[i]] + 1.0;
  if (i != 1 && arr[parent[i]].size() > 1) {
    ans[i] += (sum[parent[i]] - sum[i] - 1) / 2.0;
  }
  for (auto j : arr[i]) {
    calc(j);
  }
}
int main() {
  cin >> N;
  for (int i = 2; i <= N; i++) {
    cin >> x;
    parent[i] = x;
    arr[x].push_back(i);
  }
  pre(1);
  calc(1);
  for (int i = 1; i <= N; i++) {
    cout << ans[i] << ' ';
  }
}
