#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3fLL;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int maxn = 1e5 + 10;
int n, sz[maxn];
vector<int> g[maxn];
double ans[maxn];
void dfs1(int x) {
  sz[x] = 1;
  for (int i = 0; i < (int)g[x].size(); i++) {
    int v = g[x][i];
    dfs1(v);
    sz[x] += sz[v];
  }
}
void dfs2(int u) {
  for (int i = 0; i < (int)g[u].size(); i++) {
    int v = g[u][i];
    ans[v] = ans[u] + 1 + (sz[u] - sz[v] - 1) * 1.0 / 2;
    dfs2(v);
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int x = read();
    g[x].push_back(i);
  }
  dfs1(1);
  ans[1] = 1.0;
  dfs2(1);
  for (int i = 1; i <= n; i++) printf("%.1f ", ans[i]);
  puts("");
  return 0;
}
