Given below are a legal principle and a factual situation. Apply the given legal principle to the factual situation and select the most appropriate answer to the question given below:
Principle: Whoever enters into or upon the property in the possession of another with the intent to commit an offence or to intimidate, insult or annoy any person in possession of such property or having lawfully entered into or upon such property, unlawfully remains there with an intent to intimidate, insult or annoy any such person, or with the intent to commit an offence commits criminal trespass.
Factual Situation: A went to Delhi Law College to participate in a competition. After participating in the competition, A hid inside the campus so that he could steal a few books from the library.