a) You can finish landing formalities , without leaving Canadian territory , at an office in Montreal.
b) You can also drive to one of the Quebec-USA borders and do flag poling. You technically leave Canada, go into no-mans land, get "not allowed in USA" slip from USA and then enter Canada to finish PR formalities.
c) Fly out of Canada and then fly back to Montreal International Airport.