Solving for #w#:
#2w + 9m = 77#
#2w + 9m - color(red)(9m) = 77 - color(red)(9m)#
#2w + 0 = 77 - 9m#
#2w = 77 - 9m#
#(2w)/color(red)(2) = (77 - 9m)/color(red)(2)#
#(color(red)(cancel(color(black)(2)))w)/cancel(color(red)(2)) = (77 - 9m)/2#
#w = (77 - 9m)/2#
Solving for #m#:
#2w + 9m = 77#
#2w - color(red)(2w) + 9m = 77 - color(red)(2w)#
#0 + 9m = 77 - 2w#
#9m = 77 - 2w#
#(9m)/color(red)(9) = (77 - 2w)/color(red)(9)#
#(color(red)(cancel(color(black)(9)))m)/cancel(color(red)(9)) = (77 - 2w)/9#
#m = (77 - 2w)/9#