#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int N = 1005;
inline long long rd() {
  long long x = 0;
  char c = getchar();
  bool f = false;
  while (!isdigit(c)) {
    if (c == '-') f = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f ? -x : x;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long sqr(long long x) { return x * x; }
int n;
vector<int> vc[300005];
double dp[300005];
int Siz[300005];
void dfs(int rt) {
  int siz = vc[rt].size();
  Siz[rt] = siz;
  for (int i = 0; i < siz; i++) {
    int to = vc[rt][i];
    dfs(to);
    Siz[rt] += Siz[to];
  }
}
void Treedp(int rt) {
  int size = vc[rt].size();
  for (int i = 0; i < size; i++) {
    int to = vc[rt][i];
    dp[to] = dp[rt] + 1.0 + (Siz[rt] - Siz[to] - 1) * 0.5;
    Treedp(to);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    vc[x].push_back(i);
  }
  dfs(1);
  dp[1] = 1.0;
  Treedp(1);
  for (int i = 1; i <= n; i++) {
    printf("%.7lf ", 1.0 * dp[i]);
  }
  return 0;
}
