You didn't give the models of the drives you're talking about. But
assuming they are current models, You want to put the two harddrives on
one IDE channel and the two optical drives on the other IDE channel.
The reasoning here is that current harddrives have faster data transfer
rates than current optical drives, and so if you put one harddrive on IDE
1 as Master and one optical drive on IDE 1 as Slave, the harddrive's data
transfer rate will be no faster than the slower speed of the attached
optical drive.