Station X of length 900 meters has two station masters A and B. But as the station is not a busy one, they are mostly jobless and decide to conduct an experiment. They stand at either end of the station and decide to note the exact time when trains cross the station masters. They synchronize their watches and proceed to either end of the station. Two trains P and Q go past the station (neither train stops here), and after having taken down their readings, the station masters sit down to have a chat.
A: Train P entered the station at exactly 8:00:00
B: Train Q entered the station at exactly 8:00:10 (10 seconds past 8)
A: The last carriage of train P crossed me by at 8:00:20, and precisely two seconds after this, the engines of the two trains went past each other. (Engines are at the front of the train)
B: The last carriage of train Q crossed me 22 seconds after the engine of P went past me.
A: After the last carriage of train P crossed by me, it took 35 seconds for the engine of train Q to cross me.
B: I got bored and I came here.