#include <bits/stdc++.h>
using namespace std;
int dfs_size(int node, const vector<vector<int>>& children,
             vector<int>& subtree_size);
void dfs_start(int node, const vector<vector<int>>& children,
               const vector<int>& subtree_size,
               vector<int>& expected_start_time);
int main() {
  int cities;
  cout.precision(1);
  cout.setf(ios::showpoint | ios::fixed);
  while (cin >> cities) {
    vector<vector<int>> children(cities);
    for (int c = 1; c < cities; c++) {
      int parent;
      cin >> parent;
      children[parent - 1].push_back(c);
    }
    vector<int> subtree_size(cities);
    dfs_size(0, children, subtree_size);
    vector<int> expected_start_time(cities);
    expected_start_time[0] = 2;
    dfs_start(0, children, subtree_size, expected_start_time);
    for (int c = 0; c < cities; c++)
      cout << expected_start_time[c] / 2.0 << ' ';
    cout << '\n';
  }
}
int dfs_size(int node, const vector<vector<int>>& children,
             vector<int>& subtree_size) {
  subtree_size[node] = 1;
  for (int i = 0; i < children[node].size(); i++)
    subtree_size[node] += dfs_size(children[node][i], children, subtree_size);
  return subtree_size[node];
}
void dfs_start(int node, const vector<vector<int>>& children,
               const vector<int>& subtree_size,
               vector<int>& expected_start_time) {
  int sibling_sizes = subtree_size[node] - 1;
  for (int i = 0; i < children[node].size(); i++) {
    int child = children[node][i];
    expected_start_time[child] =
        expected_start_time[node] + (sibling_sizes - subtree_size[child]) + 2;
    dfs_start(child, children, subtree_size, expected_start_time);
  }
}
