1) There are 5 letter that can be selected for the 1st place; 4 letters - for the 2nd place; and 3 letters for the 3rd place. Total: 5*4*3=60
2) There are 1*1*3=3 letter combinations that include both A and B
3) These 3 combinations can be arranged in 3! different ways 3*3!=18
4) Now you have to think about all the possible scenarios that include both A and B: AB*(3), *AB(3), BA*(3),*BA(3) scenarios have A and B together, but A*B and B*A scenarios do not.
5) We need to deduct the first category 3+3+3+3=12 out of the total number of arrangements: 60-12=48