#include <bits/stdc++.h>
using namespace std;
namespace Fast_IO {
const int MAXL((1 << 18) + 1);
int iof, iotp;
char ioif[MAXL], *ioiS, *ioiT, ioof[MAXL],
    *iooS = ioof, *iooT = ioof + MAXL - 1, ioc, iost[55];
char Getchar() {
  if (ioiS == ioiT) {
    ioiS = ioif;
    ioiT = ioiS + fread(ioif, 1, MAXL, stdin);
    return (ioiS == ioiT ? EOF : *ioiS++);
  } else
    return (*ioiS++);
}
void Write() {
  fwrite(ioof, 1, iooS - ioof, stdout);
  iooS = ioof;
}
void Putchar(char x) {
  *iooS++ = x;
  if (iooS == iooT) Write();
}
inline int read() {
  int x = 0;
  for (iof = 1, ioc = Getchar(); (ioc < '0' || ioc > '9') && ioc != EOF;)
    iof = ioc == '-' ? -1 : 1, ioc = Getchar();
  if (ioc == EOF) exit(0);
  for (x = 0; ioc <= '9' && ioc >= '0'; ioc = Getchar())
    x = (x << 3) + (x << 1) + (ioc ^ 48);
  return x * iof;
}
inline long long read_ll() {
  long long x = 0;
  for (iof = 1, ioc = Getchar(); (ioc < '0' || ioc > '9') && ioc != EOF;)
    iof = ioc == '-' ? -1 : 1, ioc = Getchar();
  if (ioc == EOF) exit(0);
  for (x = 0; ioc <= '9' && ioc >= '0'; ioc = Getchar())
    x = (x << 3) + (x << 1) + (ioc ^ 48);
  return x * iof;
}
template <class Int>
void Print(Int x, char ch = '\0') {
  if (!x) Putchar('0');
  if (x < 0) Putchar('-'), x = -x;
  while (x) iost[++iotp] = x % 10 + '0', x /= 10;
  while (iotp) Putchar(iost[iotp--]);
  if (ch) Putchar(ch);
}
void Getstr(char *s, int &l) {
  for (ioc = Getchar(); ioc == ' ' || ioc == '\n' || ioc == '\t';)
    ioc = Getchar();
  if (ioc == EOF) exit(0);
  for (l = 0; !(ioc == ' ' || ioc == '\n' || ioc == '\t' || ioc == EOF);
       ioc = Getchar())
    s[l++] = ioc;
  s[l] = 0;
}
void Putstr(const char *s) {
  for (int i = 0, n = strlen(s); i < n; ++i) Putchar(s[i]);
}
}  // namespace Fast_IO
using namespace Fast_IO;
const int MAX = 1e5 + 50;
const long long MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
long long qpow(long long a, long long n) {
  long long res = 1LL;
  while (n) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return res;
}
long long qpow(long long a, long long n, long long p) {
  a %= p;
  long long res = 1LL;
  while (n) {
    if (n & 1) res = res * a % p;
    a = a * a % p;
    n >>= 1;
  }
  return res;
}
long long npow(long long a, long long n) {
  long long res = 1LL;
  while (n) {
    if (n & 1) res = res * a;
    a = a * a;
    n >>= 1;
    if (res < 0 || a < 0) return 0;
  }
  return res;
}
long long inv(long long a) { return qpow(a, MOD - 2); }
long long inv(long long a, long long p) { return qpow(a, p - 2, p); }
int n;
vector<int> V[MAX];
int sz[MAX];
double dp[MAX];
void dfs(int x, int de) {
  sz[x] = 1;
  for (auto it : V[x]) {
    dfs(it, de + 1);
    sz[x] += sz[it];
  }
  dp[x] = (n - sz[x] + de) / 2.0 + 1;
}
int main() {
  n = read();
  for (int i = 2; i <= n; ++i) {
    int t = read();
    V[t].push_back(i);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; ++i) {
    printf("%.2f\n", dp[i]);
  }
  return 0;
}
