#include <bits/stdc++.h>
using namespace std;
inline bool checkBit(long long n, int i) { return n & (1LL << i); }
inline long long setBit(long long n, int i) { return n | (1LL << i); }
inline long long resetBit(long long n, int i) { return n & (~(1LL << i)); }
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline double dist(double ix, double iy, double jx, double jy) {
  return sqrt(((ix - jx) * (ix - jx)) + ((iy - jy) * (iy - jy)));
}
int marked[1000000 / 64 + 2];
bool isPrime(int x) {
  return (x > 1) &&
         ((x == 2) ||
          ((x & 1) && (!((marked[x >> 6] & (1 << ((x & 63) >> 1)))))));
}
void seive(int n) {
  int i, j;
  for (i = 3; i * i <= n; i += 2) {
    if (!(marked[i >> 6] & (1 << ((i & 63) >> 1)))) {
      for (j = i * i; j <= n; j += i << 1) {
        marked[j >> 6] |= (1 << ((j & 63) >> 1));
      }
    }
  }
}
long long bigMod(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) (r *= a) %= 1000000007;
    b >>= 1;
    (a *= a) %= 1000000007;
  }
  return r;
}
double fc[100007], sum[100007], ans[100007];
vector<int> edge[100007];
int sz[100007];
int dfs(int i) {
  sz[i] = 1;
  for (int k = 0; k < edge[i].size(); k++) sz[i] += dfs(edge[i][k]);
  return sz[i];
}
void cal(int i) {
  int tot = sz[i] - 1;
  int s = edge[i].size();
  for (int k = 0; k < edge[i].size(); k++) {
    ans[edge[i][k]] = (tot - sz[edge[i][k]]) / 2.0 + ans[i] + 1;
    cal(edge[i][k]);
  }
}
int main() {
  int i, n, x;
  fc[0] = 1;
  for (i = 1; i <= 100000; i++) {
    fc[i] = fc[i - 1] * i;
    sum[i] = fc[i] + sum[i - 1];
  }
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    scanf("%d", &x);
    edge[x].push_back(i);
  }
  dfs(1);
  ans[1] = 1.0;
  cal(1);
  for (i = 1; i <= n; i++) printf("%.1lf ", ans[i]);
  printf("\n");
  return 0;
}
