#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> tree[N];
int n;
int x;
int a[N];
int depth[N];
int sub[N];
int levl = 0;
void dfs1(int u, int par, int level) {
  depth[u] = level;
  for (int v : tree[u]) {
    if (v != par) dfs1(v, u, level + 1);
  }
}
int dfs2(int u, int par) {
  int ans = 1;
  for (int v : tree[u]) {
    if (v != par) ans += dfs2(v, u);
  }
  return sub[u] = ans;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    cin >> a[i];
    tree[a[i]].push_back(i);
    tree[i].push_back(a[i]);
  }
  dfs1(1, -1, 1);
  sub[1] = dfs2(1, -1);
  for (int i = 1; i <= n; ++i) {
    float answer = depth[i] + (n - depth[i] - sub[i] + 1) * 0.5;
    cout << setprecision(6) << fixed << answer << " ";
  }
  return 0;
}
