recursive type printing