#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const long long SZ = 100010, INF = 0x7FFFFFFF, mod = 1000000007;
long long n, siz[SZ];
vector<int> mp[SZ];
double res[SZ];
void dfs1(int x) {
  siz[x] = 1;
  for (int i = 0; i < mp[x].size(); ++i) {
    int to = mp[x][i];
    dfs1(to);
    siz[x] += siz[to];
  }
}
void dfs2(int x, int p) {
  if (p == -1) {
    res[x] = 1;
  } else {
    res[x] = res[p] + 1 + (siz[p] - siz[x] - 1) * 0.5;
  }
  for (int i = 0; i < mp[x].size(); ++i) {
    int to = mp[x][i];
    dfs2(to, x);
  }
}
void init() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    int a;
    cin >> a;
    mp[a].push_back(i);
  }
  dfs1(1);
  dfs2(1, -1);
  for (int i = 1; i <= n; ++i) {
    if (i != 1) cout << " ";
    cout << fixed << setprecision(10) << res[i];
  }
  cout << endl;
}
void work() {}
int main() {
  long long casenum;
  {
    init();
    work();
  }
  return 0;
}
