#include <bits/stdc++.h>
const long long int MAX = (long long int)(1e18 + 1);
const long long int MIN = (long long int)(-1e18 - 1);
const long long int mod = (long long int)(1e9 + 7);
using namespace std;
long long int max(long long int a, long long int b, long long int c) {
  return max(max(a, b), c);
}
long long int min(long long int a, long long int b, long long int c) {
  return min(min(a, b), c);
}
long long int max(long long int a, long long int b) { return (a > b) ? a : b; }
long long int min(long long int a, long long int b) { return (a < b) ? a : b; }
long long int power(long long int a, long long int n) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long int power_mod(long long int a, long long int n, long long int mod_) {
  long long int p = 1;
  while (n) {
    if (n % 2) {
      p = (p * a) % mod_;
    }
    n /= 2;
    a = (a * a) % mod_;
  }
  return p % mod_;
}
vector<vector<long long int>> graph;
vector<double> ans;
vector<long long int> col, st, ed, par;
long long int tme = 0;
void dfs(long long int x) {
  col[x] = 1;
  st[x] = ++tme;
  for (auto y : graph[x]) {
    if (col[y] == 0) par[y] = x, dfs(y);
  }
  ed[x] = tme;
}
void dfs1(long long int x) {
  col[x] = 1;
  long long int sum = 0;
  for (auto y : graph[x]) {
    if (col[y] == 0) {
      sum += (ed[y] - st[y] + 1);
    }
  }
  for (auto y : graph[x]) {
    if (col[y] == 0) {
      ans[y] = (ans[x] + 1 + 1.0 * (sum - 1.0 * (ed[y] - st[y] + 1.0)) / 2.0);
    }
  }
  for (auto y : graph[x]) {
    if (col[y] == 0) {
      dfs1(y);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cout << setprecision(15);
  long long int mn = MAX, mx = MIN;
  long long int n, t, m, k, i, j, sum = 0, prev, flag = 0, cnt = 0;
  long long int x = 0, y = 0, fx, diff, tot = 0, l, r;
  int TC = 1;
  while (TC--) {
    cin >> n;
    graph.assign(n, {});
    col.assign(n, 0);
    ans.assign(n, 0);
    st.assign(n, 0);
    ed.assign(n, 0);
    par.assign(n, -1);
    for (i = 0; i < n - 1; i++) {
      cin >> x;
      x--;
      graph[x].push_back(i + 1);
      graph[i + 1].push_back(x);
    }
    dfs(0);
    ans[0] = 1;
    col.assign(n, 0);
    dfs1(0);
    for (auto x : ans) cout << x << ' ';
    cout << '\n';
  }
  return 0;
}
