now is the time for all good men to come to the aid of the party the quick brown fox jumps over the lazy dog programming contests are fun arent they No solution. you are to write a program that simulates an idealized pinball machine this machine has a flat surface that has some obstacles bumpers and walls the surface is modeled as an mn grid with the origin in the lower left corner each bumper occupies a grid point the grid positions on the edge of the surface are walls balls are shot appear one at a time on the grid with an initial position direction and lifetime in this simulation all positions are integral and the balls direction is one of up down left or right the ball bounces around the grid hitting bumpers the quick brown fox jumps over the lazy dog which accumulates points and walls which does not add any points the number of points accumulated by hitting a given bumper is the value of that bumper the speed of all balls is one grid space per timestep a ball hits an obstacle during a timestep when it would otherwise move on top of the bumper or wall grid point a hit causes the ball to rebound by turning right clockwise degrees without ever moving on top of the obstacle and without changing position only the direction changes as a result of a rebound note that by this definition sliding along a wall does not constitute hitting that wall the quick brown fox jumps over the lazy dog a balls lifetime indicates how many time units the ball will live before disappearing from the surface the ball uses one unit of lifetime for each grid step it moves it also uses some units of lifetime for each bumper or wall that it hits the lifetime used by a hit is the cost of that bumper or wall as long as the ball has a positive lifetime when it hits a bumper it obtains the full score for that bumper note that a ball with lifetime one will die during its next move and thus cannot obtain points for hitting a bumper during this last move once the lifetime is nonpositive less than or equal to zero the ball disappears and the game continues with the next ball No solution. the input consists of parentchild pairs of names one pair per line each name in a pair consists of lowercase alphabetic characters or periods used to separate first and last names for example child names are separated from parent names by one or more spaces parentchild pairs are terminated by a pair whose first component is the string nochild such a pair is not to be considered as a parentchild pair but only as a delimiter to separate the parentchild pairs from the query pairs there will be no circular relationships ie no name p can be both an ancestor and a descendent of the same name q the parentchild pairs are followed by a sequence of query pairs in the same format as the parentchild pairs ie each name in a query pair is a sequence of lowercase alphabetic characters and periods and names are separated by one or more spaces query pairs are terminated by endoffile there will be a maximum of different names overall parentchild and query pairs all names will be fewer than characters in length there will be no more than query pairs the quick brown fox jumps over the lazy dog