Your task is to fill out the solve(lines) method of the sample starter-code (defining extra functions if you need them). Your program should take, as input, the entire sample input displayed below, and produce the entire sample output, as displayed below. You should save the sample input as a file like "a4.in", and the sample code as a file like "a4.py", and then invoke your program to test it by entering the command "python a4.py < a4.in", which will feed the sample input, as input to your program. A good place to start is to add "print lines" to solve() and see what it looks like. In the input, "A < B" means that A is in front of B, and "A > B" means that A is behind B. The input is divided up into several cases. Cases are separated by at least one blank line. (The sample code already takes care of input for you, but you still need to understand how the input is organized.) In the output for each input case, you should write whichever ONE of the following statements is true of the input case. "The only possible order is [...]", "One possible order is [...]", or "The input is self-contradictory", where "[...]" is a list of names, separated by spaces (no commas, no other symbols), as in the sample output below. Sample input: ------------------------------------------------ Alice > Bob Bob < Cho Cho > Dai Dai > Alice Alice < Bob Cho < Bob Cho < Dai Dai < Alice Alice < Bob Cho > Bob Cho < Dai Dai < Alice A < B C < D 1 < 17 5 > 3 200 > 5 16 > 5 17 > 16 200 > 17 1 < 3 ------------------------------------------------ Sample output: ------------------------------------------------ The only possible order is Bob Alice Dai Cho The only possible order is Cho Dai Alice Bob The input is self contradictory One possible order is C D A B The only possible order is 1 3 5 16 17 200 ------------------------------------------------ Sample starter-code: ------------------------------------------------ import sys def solve(lines): # if lines is empty, there is no case to solve, so just return nil if len(lines) == 0: return # otherwise, we need to solve the case, here. def main(): lines = sys.stdin.read().split('\n') lastblank = -1 for i in range(len(lines)+1): # if we read a blank line or reach the end of the input, # then we may have finished reading a test case (so we solve it) if i == len(lines) or len(lines[i]) == 0: solve(lines[lastblank+1:i]) lastblank = i main()