TDP Inc. has decided to sue JCN Inc. for copy- right infringement. To this end, TDP wishes to find infringing segments within JCN’s code base, to show to selected media representatives. Since TDP has fired all its technical staff, it is looking to hire a consultant to be paid on a con- tingency basis should the lawsuit be successful. To demonstrate your qualifications for this po- sition, you are to solve the problem on a number of test cases. Input Each test case begins with a positive integer k, the number of infringing segments to be found. Following this line are two code bases. The first code base is preceded by the line ‘BEGIN TDP CODEBASE’ and contains a number of lines followed by the line ‘END TDP CODEBASE’. The second code base is preceded by ‘BEGIN JCN CODEBASE’ and followed by ‘END JCN CODEBASE’. The line ‘END TDP CODEBASE’ does not appear in the first code base and the line ‘END JCN CODEBASE’ does not appear in the second. A line containing ‘0’ follows the last test case. Output For each test case you should output:
2/2 the quick brown fox jumps over the lazy dog. so there! END TDP CODEBASE BEGIN JCN CODEBASE now is the time for all good men to come to the aid of the party. so there! END JCN CODEBASE 100 BEGIN TDP CODEBASE xyzzy END TDP CODEBASE BEGIN JCN CODEBASE xyzzabczzyy END JCN CODEBASE 0 Sample Output CASE 1 INFRINGING SEGMENT 1 LENGTH 12 POSITION 64 . so there! INFRINGING SEGMENT 2 LENGTH 5 POSITION 6 the INFRINGING SEGMENT 3 LENGTH 5 POSITION 42 o the INFRINGING SEGMENT 4 LENGTH 5 POSITION 43 the INFRINGING SEGMENT 5 LENGTH 5 POSITION 54 the INFRINGING SEGMENT 6 LENGTH 3 POSITION 15 fo CASE 2 INFRINGING SEGMENT 1 LENGTH 4 POSITION 0 xyzz INFRINGING SEGMENT 2 LENGTH 3 POSITION 7 zzy INFRINGING SEGMENT 3 LENGTH 2 POSITION 10 y