How do you easily solve this kind of question?