#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100010];
double E[100010];
long long sum[100010];
void dfs1(int in) {
  sum[in] = 1;
  for (int i = 0; i < adj[in].size(); i++) {
    dfs1(adj[in][i]);
    sum[in] += sum[adj[in][i]];
  }
}
int p[100010];
void dfs2(int in) {
  if (in != 1) E[in] = (2 * (E[p[in]] + 1) + sum[p[in]] - 1 - sum[in]) / 2;
  for (int i = 0; i < adj[in].size(); i++) {
    dfs2(adj[in][i]);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    adj[p[i]].push_back(i);
  }
  dfs1(1);
  E[1] = 1.0;
  dfs2(1);
  for (int i = 1; i <= n; i++) printf("%.9lf ", E[i]);
  return 0;
}
