Egyptian literature
It has been suggested that the origins of the tale type may have been first recorded in Ancient Egyptian literature, in "The Tale of the Doomed Prince", wherein a prince needs to reach the princess's window by climbing a very tall tower.