Random hierarchy generator