#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000;
int n;
int p[MAX];
vector<int> children[MAX];
int counts[MAX];
double res[MAX];
void dfs1(int v) {
  int curr = 1;
  for (int i = 0; i < children[v].size(); ++i) {
    int u = children[v][i];
    dfs1(u);
    curr += counts[u];
  }
  counts[v] = curr;
}
void dfs2(int v) {
  int curr = 0;
  for (int i = 0; i < children[v].size(); ++i) {
    int u = children[v][i];
    curr += counts[u];
  }
  for (int i = 0; i < children[v].size(); ++i) {
    int u = children[v][i];
    res[u] = res[v] + 1 + (double)(curr - counts[u]) / 2.0;
  }
  for (int i = 0; i < children[v].size(); ++i) {
    int u = children[v][i];
    dfs2(u);
  }
}
int main(int argc, char* argv[]) {
  cin >> n;
  p[0] = 0;
  for (int i = 1; i < n; ++i) {
    int curr;
    cin >> curr;
    --curr;
    p[i] = curr;
    children[curr].push_back(i);
  }
  dfs1(0);
  res[0] = 1;
  dfs2(0);
  for (int i = 0; i < n; ++i) {
    cout << res[i] << " ";
  }
  cout << endl;
  return 0;
}
