#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<double> dp;
vector<double> s;
vector<double> ans;
void dfs(int v, int p = 0) {
  for (int i = (0); i < (g[v].size()); i++)
    if (g[v][i] != p) {
      dfs(g[v][i], v);
      s[v] += s[g[v][i]];
    }
  s[v]++;
}
void dfs1(int v, int p = 0) {
  for (int i = (0); i < (g[v].size()); i++) {
    int to = g[v][i];
    if (to != p) {
      ans[to] = ans[v] + 0.5 * (s[v] - 1 - s[to]) + 1;
      dfs1(to, v);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, p;
  cin >> n;
  g.resize(n);
  s.assign(n, 0);
  dp.assign(n, 0);
  ans.assign(n, 0);
  ans[0] = 1.0;
  for (int i = (1); i < (n); i++) {
    cin >> p;
    p--;
    g[p].push_back(i);
  }
  dfs(0);
  dfs1(0);
  for (int i = (0); i < (n); i++)
    cout << fixed << setprecision(9) << ans[i] << " ";
  cout << '\n';
  return 0;
}
