#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
vector<double> starting_time;
vector<vector<int> > v;
double len(int u) {
  static vector<int> l(v.size(), -1);
  if (l[u] != -1) {
    return l[u];
  }
  l[u] = 1;
  for (auto i : v[u]) {
    l[u] += len(i);
  }
  return l[u];
}
void dfs(int u) {
  for (auto i : v[u]) {
    starting_time[i] = starting_time[u] + 1 + (len(u) - len(i) - 1) / 2;
    dfs(i);
  }
}
inline void solve4() {
  int n;
  cin >> n;
  v.resize(n + 1);
  starting_time.resize(n + 1, 0);
  for (int i = 2; i <= n; ++i) {
    int a;
    cin >> a;
    v[a].push_back(i);
  }
  starting_time[1] = 1;
  dfs(1);
  for (int i = 1; i <= n; ++i) {
    cout << fixed << setprecision(8) << starting_time[i] << ' ';
  }
}
int main() {
  solve4();
  return 0;
}
