#include <bits/stdc++.h>
using namespace std;
int mod1 = 998244353;
int mod2 = 1000000007;
void dfs(vector<vector<int>> &child, vector<int> &subtree, int v) {
  for (int u : child[v]) {
    dfs(child, subtree, u);
    subtree[v] += subtree[u];
  }
}
void dfs1(vector<vector<int>> &child, vector<double> &exp_val,
          vector<int> &subtree, int v) {
  for (int u : child[v]) {
    exp_val[u] = exp_val[v] + 1 + (subtree[v] - subtree[u] - 1) / 2.0;
    dfs1(child, exp_val, subtree, u);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x;
  cin >> n;
  vector<vector<int>> child(n + 1);
  vector<int> subtree(n + 1, 1);
  vector<double> exp_val(n + 1, 1);
  for (int i = 2; i < n + 1; i++) {
    cin >> x;
    child[x].push_back(i);
  }
  dfs(child, subtree, 1);
  dfs1(child, exp_val, subtree, 1);
  for (int i = 1; i < n + 1; i++) cout << setprecision(15) << exp_val[i] << " ";
  return 0;
}
