M - (647 - 138) = 2380
m - 509 = 2380
m = 2380 + 509
m = 2889
Проверка: 2889 - (647 - 138) = 2380
2889 - 509 = 2380
2380 = 2380
6000 - (n + 495) = 4730
n + 495 = 6000 - 4730
n + 495 = 1270
n = 1270 - 495
n = 775
Проверка: 6000 - (775 + 495) = 4730
6000 - 1270 = 4730
4730 = 4730