#include <bits/stdc++.h>
using namespace std;
int p[200000], n;
double a[200000], ans[200000];
vector<int> ch[200000];
int dfs(int v) {
  for (int i = 0; i < ch[v].size(); i++) a[v] += dfs(ch[v][i]);
  return a[v] + 1;
}
void DFS(int v) {
  for (int i = 0; i < ch[v].size(); i++) {
    ans[ch[v][i]] = ans[v] + (a[v] - a[ch[v][i]] - 1) / 2 + 1;
    DFS(ch[v][i]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    ch[p[i]].push_back(i);
  }
  n = dfs(1);
  ans[1] = 1;
  DFS(1);
  for (int i = 1; i <= n; i++) cout << ans[i] << endl;
}
