The Glengarry and Stormont Railway (G&SR) was a short line railway running from the town of Cornwall in eastern Ontario to connect to the Canadian Pacific Railway's (CP) Ontario and Quebec Railway (O&Q) mainline just inside the Quebec border, a total distance of about 45 kilometers .