You ask one twin, “Are you twins?”. If he says “Yes”, he is telling the truth. Therefore, you ask the other twin which way to go and go the opposite way because he is lying. If he says “No”, he is the liar and you ask the other twin which way to go because he is telling the truth.