#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T sgn(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
int n;
int m;
const int N = 1e5 + 10;
long double ans[N], fact_inv[N];
vector<int> v[N];
int go(int x) {
  vector<int> res;
  int sum = 0;
  for (auto y : v[x]) {
    int cur = go(y);
    res.push_back(cur);
    sum += cur;
  }
  int n = ((int)(res).size());
  for (int i = 0; i < n; i++) {
    int y = v[x][i];
    ans[y] = (n > 1 ? (((long double)sum - res[i]) / 2.0) : 0) + 1;
  }
  return sum + 1;
}
void go2(int x) {
  for (auto y : v[x]) {
    ans[y] += ans[x];
    go2(y);
  }
}
int main() {
  scanf("%d", &n);
  fact_inv[0] = 1.0;
  for (int i = 1; i < n; i++) fact_inv[i] = fact_inv[i - 1] / i;
  for (int i = 1; i < n; i++) {
    int p;
    scanf("%d", &p);
    p--;
    v[p].push_back(i);
  }
  ans[0] = 1.0;
  go(0);
  go2(0);
  for (int i = 0; i < n; i++) printf("%0.10f ", (double)ans[i]);
  return 0;
}
