#include <bits/stdc++.h>
using namespace std;
const int maxn = 123456;
int p[maxn];
vector<int> children[maxn];
double size[maxn];
double ans[maxn];
void dfs(int u) {
  size[u] = 1;
  for (auto &&v : children[u]) {
    dfs(v);
    size[u] += size[v];
  }
  for (auto &&v : children[u]) {
    ans[v] = (size[u] - 1 - size[v]) / 2.0 + 1;
  }
}
void dfs2(int u) {
  for (auto &&v : children[u]) {
    ans[v] += ans[u];
    dfs2(v);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    cin >> p[i];
    children[p[i]].push_back(i);
  }
  dfs(1);
  ans[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; ++i) {
    printf("%.15f ", ans[i]);
  }
  puts("");
}
