#include <bits/stdc++.h>
using namespace std;
vector<int> adj[(int)2e5 + 3];
int num[(int)2e5 + 3];
int dfs(int x, int pa) {
  int m = 1;
  for (int i = 0; i < adj[x].size(); i++) {
    int y = adj[x][i];
    if (y == pa) continue;
    m += dfs(y, x);
  }
  num[x] = m;
  return m;
}
queue<int> Q;
long double ext[(int)2e5 + 3];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int x, y;
    cin >> y;
    adj[i].push_back(y);
    swap(i, y);
    adj[i].push_back(y);
    swap(i, y);
  }
  dfs(1, 0);
  Q.push(1);
  ext[1] = 1;
  while (!Q.empty()) {
    int x = Q.front();
    Q.pop();
    int sigma = num[x] - 1;
    for (int i = 0; i < adj[x].size(); i++) {
      int y = adj[x][i];
      if (ext[y] != 0) continue;
      long double an = (num[x] - (long double)num[y] + 1) / 2.0;
      ext[y] = ext[x] + an;
      Q.push(y);
    }
  }
  cout << fixed;
  cout.precision(7);
  for (int i = 1; i <= n; i++) {
    cout << ext[i] << ' ';
  }
  return 0;
}
