#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 20, inf = 2e9 + 20, mod = 1e9 + 7;
const string YN[] = {"NO", "YES"};
int d[maxn], s[maxn];
vector<int> ch[maxn];
void dfs(int u = 1) {
  for (int i = 0; i < ch[u].size(); ++i) {
    int v = ch[u][i];
    d[v] = d[u] + 1;
    dfs(v);
    s[u] += s[v];
  }
  s[u]++;
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << setprecision(1) << fixed;
  ;
  int n;
  cin >> n;
  for (int i = 2; i < 2 + n - 1; ++i) {
    int p;
    cin >> p;
    ch[p].push_back(i);
  }
  dfs();
  for (int i = 1; i < 1 + n; ++i) {
    long double ans = (n - s[i] + d[i]) / (long double)2 + 1;
    cout << ans << ' ';
  }
  cout << endl;
  exit(0);
  ;
}
