#include <bits/stdc++.h>
using namespace std;
void calc_stats(vector<vector<int>> &g, vector<int> &children,
                vector<int> &depth, int v = 0) {
  for (int u : g[v]) {
    depth[u] = depth[v] + 1;
    calc_stats(g, children, depth, u);
    children[v] += children[u];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> children(n, 1), depth(n, 0);
  vector<vector<int>> g(n, vector<int>());
  for (int i = 1; i < n; i++) {
    int pi;
    cin >> pi;
    g[pi - 1].push_back(i);
  }
  calc_stats(g, children, depth);
  for (int i = 0; i < n; i++) {
    int me = n - children[i] - depth[i] + 2 * (depth[i] + 1);
    cout << me / 2 << ".";
    if (me & 1)
      cout << "5 ";
    else
      cout << "0 ";
  }
  cout << "\n";
  return 0;
}
