Task: Question Generation
Input (English): #1 return ships 
#2 return captains  that  #1 are commanded by 
#3 return ranks of   #2 
#4 return #1 where at least one #3 is  Midshipman 
#5 return #1 where at least one #3 is  Lieutenant 
#6 return #1 in both #4 and #5
Output (English): What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?