Optimal Solutions in Controlled Selection Problems with Two-Way Stratification