#include <bits/stdc++.h>
using namespace std;
vector<int> a[100010];
double res[100010];
int n, siz[100010];
void dfs(int u) {
  siz[u] = 1;
  for (vector<int>::iterator it = a[u].begin(); it != a[u].end(); it++) {
    int v = *it;
    dfs(v);
    siz[u] += siz[v];
  }
}
void dfs2(int u) {
  int sum = siz[u] - 1;
  for (vector<int>::iterator it = a[u].begin(); it != a[u].end(); it++) {
    int v = *it;
    res[v] = res[u] + 1 + (sum - siz[v]) / 2.0;
    dfs2(v);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = (2), _b = (n); i <= _b; i++) {
    int p;
    cin >> p;
    a[p].push_back(i);
  }
  dfs(1);
  res[1] = 1;
  dfs2(1);
  for (int i = (1), _b = (n); i <= _b; i++)
    cout << fixed << setprecision(6) << res[i] << " ";
  return 0;
}
