#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> V[100100];
int size[100100];
double expec[100100];
void read() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int q;
    cin >> q;
    V[q].push_back(i);
  }
}
void dfs(int x) {
  size[x] = 0;
  for (int i = 0; i < V[x].size(); i++) {
    dfs(V[x][i]);
    size[x] += size[V[x][i]];
  }
  size[x]++;
  return;
}
void dfs2(int x) {
  double sum = 0;
  for (int i = 0; i < V[x].size(); i++) {
    sum += size[V[x][i]];
  }
  for (int i = 0; i < V[x].size(); i++) {
    expec[V[x][i]] = expec[x] + (sum - size[V[x][i]]) / 2 + 1;
    dfs2(V[x][i]);
  }
}
int main() {
  read();
  expec[1] = 1;
  dfs(1);
  dfs2(1);
  for (int i = 1; i <= n; i++) cout << expec[i] << " ";
}
