#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > graph(100010);
long long sub[100010];
long double ans[100010];
void dfs(long long ver) {
  sub[ver] = 1;
  for (int i = 0; i < graph[ver].size(); i++) {
    dfs(graph[ver][i]);
    sub[ver] += sub[graph[ver][i]];
  }
}
void getans(long long ver) {
  long double mul = 0.5, sum = 0;
  if (graph[ver].size() == 0) return;
  for (int i = 0; i < graph[ver].size(); i++) {
    sum += sub[graph[ver][i]];
  }
  for (int i = 0; i < graph[ver].size(); i++) {
    ans[graph[ver][i]] = (sum - sub[graph[ver][i]]) * mul + ans[ver] + 1;
  }
  for (int i = 0; i < graph[ver].size(); i++) {
    getans(graph[ver][i]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long p;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    graph[p].push_back(i);
  }
  dfs(1);
  ans[1] = 1;
  getans(1);
  for (int i = 1; i <= n; i++) {
    cout << fixed << setprecision(10) << ans[i] << ' ';
  }
}
