def split_particle_type(decays):
    """
    Separate initial particle, intermediate particles, final particles in a decay chain.

    :param decays: DecayChain
    :return: Set of initial Particle, set of intermediate Particle, set of final Particle
    """
    core_particles = set()
    out_particles = set()

    for i in decays:
        core_particles.add(i.core)
        for j in i.outs:
            out_particles.add(j)

    inner = core_particles & out_particles
    top = core_particles - inner
    outs = out_particles - inner
    return top, inner, outs