#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > edges;
vector<int> sizes;
vector<double> localans;
vector<double> ans;
vector<int> p;
void dfs(int v) {
  sizes[v] = 1;
  int childnum = edges[v].size();
  for (int i = 0; i < childnum; ++i) {
    int u = edges[v][i];
    dfs(u);
    sizes[v] += sizes[u];
  }
  int total = sizes[v] - 1;
  double koef = 1 / 2.0;
  for (int i = 0; i < childnum; ++i) {
    int u = edges[v][i];
    localans[u] = koef * (total - sizes[u]);
  }
}
void sumdfs(int v, double cur) {
  ans[v] = cur;
  int childnum = edges[v].size();
  for (int i = 0; i < childnum; ++i) {
    int u = edges[v][i];
    sumdfs(u, cur + localans[u] + 1);
  }
}
int main() {
  int n;
  cin >> n;
  edges.resize(n);
  sizes.resize(n);
  localans.resize(n);
  ans.resize(n);
  for (int i = 1; i < n; ++i) {
    int x;
    cin >> x;
    edges[x - 1].push_back(i);
  }
  dfs(0);
  sumdfs(0, 1.0);
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
