Sum Up Series

0

0 votes
Problem

Gazu spent his whole childhood watching illogical Indian Tv shows, some time back he got to know these awesome American Tv series (Breaking Bug, House of Codes, Game of Threads, How I cracked your logic etc etc) but the problem is he don’t have enough time to sit and watch every single episode so he surfed the internet and found top N episodes from that show, just to be on safe side he checked another site and found top M episodes from there. Now he have two lists of all top episodes of that show. He wants to maintain the storyline, so he starts watching the episodes in increasing order. He wants your help to find the correct the sequence of the episodes..

INPUT First line contains number of Tv series he wants to see (say T). For each Tv series he gives you number ‘N’ followed by top N episodes from site1 separated by space and in the next line he gives you number ‘M’ followed by top M episodes from site2 separated by space. 1<T<100 2<N,M<100

OUTPUT For each Tv series output the correct order of episodes followed by a new line.

Sample Output
1 2 3 4 5 6 7 8 
1 2 3 4 
1 2 3 4
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For 2nd show correct order will be 1 2 3 4 from site1 and 1 2 3 from site2 combining these will give us 1 1 2 2 3 3 4 but we have to save Gazu’s time so we’ll remove the duplicate episodes so that he do not watch same episode twice.Hence correct order is 1 2 3 4.

Editor Image

?