#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 1000111;
const int INF = 1 << 30;
const ll LNF = 1LL << 60;
int n, a, s[maxn];
double ex[maxn];
vector<int> v[maxn];
int dfs(int u) {
  for (auto i = v[u].begin(); i != v[u].end(); i++) {
    s[u] += dfs(*i);
  }
  s[u] += 1;
  return s[u];
}
void dfs2(int u) {
  for (auto i = v[u].begin(); i != v[u].end(); i++) {
    ex[*i] = ex[u] + (double)(s[u] - s[*i] + 1) / 2;
    dfs2(*i);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &a);
    v[a].push_back(i);
  }
  dfs(1);
  ex[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; i++) {
    printf("%.8lf ", ex[i]);
  }
  return 0;
}
