#include <bits/stdc++.h>
using namespace std;
vector<int> a[100001];
int p[100001];
int s[100001], h[100001];
void dfs(int x) {
  s[x] = 1;
  for (int i = 0; i < a[x].size(); i++) {
    if (a[x][i] != p[x]) {
      h[a[x][i]] = 1 + h[x];
      dfs(a[x][i]);
      s[x] += s[a[x][i]];
    }
  }
}
int main() {
  int n, i, j, k;
  cin >> n;
  p[1] = 0;
  for (i = 2; i <= n; i++) {
    cin >> j;
    p[i] = j;
    a[j].push_back(i);
    a[i].push_back(j);
  }
  for (i = 0; i <= n; i++) {
    s[i] = 0;
    h[i] = 0;
  }
  dfs(1);
  double ans = 0.0;
  cout << "1.0"
       << " ";
  for (i = 2; i <= n; i++) {
    ans = (((double)(n - h[i] - s[i])) / ((double)2)) + ((double)(h[i]) + 1.0);
    cout << setprecision(10) << ans << " ";
  }
  cout << "\n";
}
