Solve the following pairs of linear (simultaneous) equations using method of elimination by substitution:
2x−3y=7
5x+y=9
2x+7y=39
3x+5y=31