Last updated Mon 1-28-2013
What is in question here is not whether the particular rotation proposed does the right thing. Instead it is getting you to think a bit about something that might have occured to you when looking at the diagrams - why is subtree X labeled as height h? or why is subtree Z labeled as h+1? Does it have to be that way? Your arguments on why the subtrees listed cannot have heights other than those given is not based on an argument like "because then the rotation will not work". Your arguments should be based on things in the state of each tree prior to the insertion and after the insertion but before the rotation.
Base your answer on what you know about the current situation: You know that an insertion has taken place in subtree Z, that node a is where an imbalance was detected, that subtree Z has height h before the insertion and height h+1 after the insertion. You also know that the entire tree and each of its subtrees were AVL trees before the insertion (all subtrees in an AVL tree must also be AVL trees).
[2013-01-28] In case someone read the problem before I added in the comma between 12 and 17, notice that there is now a comma between the 12 and the 17! :-)