#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > child;
vector<int> parent;
vector<double> EV;
vector<int> S;
int dfs(int u) {
  int s = 0;
  for (int i = 0 - (0 > (int)((child[u]).size()));
       i != (int)((child[u]).size()) - (0 > (int)((child[u]).size()));
       i += 1 - 2 * (0 > (int)((child[u]).size()))) {
    int v = child[u][i];
    s += dfs(v);
  }
  return S[u] = s + 1;
}
void dfs2(int u) {
  for (int i = 0 - (0 > (int)((child[u]).size()));
       i != (int)((child[u]).size()) - (0 > (int)((child[u]).size()));
       i += 1 - 2 * (0 > (int)((child[u]).size()))) {
    int v = child[u][i];
    EV[v] = 1 + EV[u] + (S[u] - 1 - S[v]) * 0.5;
    dfs2(v);
  }
}
int main() {
  cin >> n;
  child.assign(n + 1, vector<int>());
  parent.assign(n + 1, -1);
  parent[1] = 0;
  EV.assign(n + 1, 1.0);
  S.assign(n + 1, 0);
  EV[1] = 1;
  for (int i = 0 - (0 > n - 1); i != n - 1 - (0 > n - 1);
       i += 1 - 2 * (0 > n - 1)) {
    cin >> parent[i + 2];
    child[parent[i + 2]].push_back(i + 2);
  }
  dfs(1);
  dfs2(1);
  for (int i = 1 - (1 > n + 1); i != n + 1 - (1 > n + 1);
       i += 1 - 2 * (1 > n + 1))
    cout << setprecision(15) << EV[i] << " ";
  cout << "\n";
  return 0;
}
