generate random trees with instance ids