Two​ trains, Train A and Train​ B, weigh a total of 511 tons. Train A is heavier than Train B. The difference of their weights is 315 tons. What is the weight of each​ train?