#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
const int MAXN = 100001;
int s[MAXN];
vector<int> e[MAXN];
int ans[MAXN];
int p[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    e[x].push_back(i);
    p[i] = x;
  }
  for (int i = n; i >= 1; i--) {
    s[i] = 1;
    for (int j = 0; j < e[i].size(); j++) s[i] += s[e[i][j]];
  }
  ans[1] = 2;
  for (int i = 1; i <= n; i++) {
    int cc = ans[i];
    for (int j = 0; j < e[i].size(); j++) {
      cc += s[e[i][j]];
    }
    for (int j = 0; j < e[i].size(); j++) {
      ans[e[i][j]] = cc - s[e[i][j]] + 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << (ans[i] / 2) << "." << (ans[i] % 2) * 5 << " ";
  }
  return 0;
}
