On a Friday evening, Bajtazar and his friends head to a club for a game of billiards. As usual at such gatherings, an argument breaks out between Bajtazar and Bitol. Bajtazar claims that Bitol's strategy is pointless, because the ball he strikes has no chance of dropping into a pocket. Bitol insists that if he hit the ball hard enough, it would eventually fall into some pocket. Help settle their argument: write a program that decides whether the ball really would fall into a pocket, and if so, which one.
Your program should:
The one and only line contains six integers sx, sy, px, py, wx, wy separated by single spaces:
The table is sx long and sy wide. Pockets sit at the four corners and at the midpoints of the two sides of length sx. For example, a table of size (8,3) has pockets at (0,0), (4,0), (8,0), (0,3), (4,3), and (8,3). The ball never leaves the table and moves without friction; every bounce off a cushion follows the rule that the angle of incidence equals the angle of reflection. The ball drops into a pocket exactly when it reaches the point where that pocket is located.
Print a single line: the name of the pocket the ball drops into, or the word NIE if that never happens. The pocket names are:
GL: the pocket at (0,sy)GP: the pocket at (sx,sy)GS: the pocket at (sx/2,sy)DL: the pocket at (0,0)DP: the pocket at (sx,0)DS: the pocket at (sx/2,0)