おわりすると
owarisuruto

Suru Verb

The "-to" conditional form ("if/when…") of 了する

1. If/when understood; If/when figured out; If/when realized

To Conditional