Once upon a time, Sasha fell asleep so deeply that he was able to rewrite the laws of physics, and now in his reality, a day lasts $30$ hours.

And today he decided not to rewrite the laws, but to go to classes. He has been assigned $x$ classes, each lasting $90$ minutes. In addition to classes, Sasha, like any decent student, has some unfinished homework, so today he decided to complete all the assignments.

There are a total of $n$ unfinished homework assignments, and it will take Sasha $a_i$ minutes to complete each of them.

Inform poor Sasha how many hours and minutes he will sleep today, if he needs to attend all the classes and complete all the homework. Note that he cannot do more than one task at a time. Also, he cannot do his homework while on classes. 