#include <bits/stdc++.h>
using namespace std;
inline long long rit() {
  int key = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') key = -1;
    c = getchar();
  }
  long long x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * key;
}
vector<int> G[100010];
int sz[100010];
double ans[100010];
int n;
void dfs1(int u) {
  sz[u] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    dfs1(v);
    sz[u] += sz[v];
  }
}
void dfs2(int u, double e) {
  ans[u] = e;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    int other = sz[u] - sz[v] - 1;
    dfs2(v, e + 1 * 0.5 + (other + 1) * 0.5);
  }
}
void init() {}
void read() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    G[rit() - 1].push_back(i);
  }
}
void solve() {
  dfs1(0);
  dfs2(0, 1.0);
  for (int i = 0; i < n; i++) printf("%.10lf ", ans[i]);
  cout << endl;
}
int main() {
  init();
  read();
  solve();
  return 0;
}
