{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cbr\u003e\u003ci\u003eN\u003c/i\u003e teams participate in a championship. It consists of two contests; each of the teams participates in both. Each contest has its own rating. Then the final rating is made. If for some \u003ci\u003eM\u003c/i\u003e (1≤ \u003ci\u003eM\u003c/i\u003e≤ \u003ci\u003eN\u003c/i\u003e) the sets of first \u003ci\u003eM\u003c/i\u003e teams in both ratings are the same, then this set is the set of the first \u003ci\u003eM\u003c/i\u003e teams in the final rating. Teams whose relative order cannot be determined using this rule are placed in alphabetical order.\u003cbr\u003eYou are given the contests\u0027 ratings. Your task is to generate the final rating.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of the input contains an integer \u003ci\u003eN\u003c/i\u003e (1≤ \u003ci\u003eN\u003c/i\u003e≤ 50000). The two ratings follow. Each of the ratings consists on \u003ci\u003eN\u003c/i\u003e lines, each of which contains a team\u0027s name, being a string of at most 20 lowercase Latin letters and digits.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eOutput the final rating in the same format as in the input.\u003cbr\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\nspbifmo1\nmsu1\nmsu2\npermsu\nnsu1\nnnsu\nspbifmo1\nmsu1\npermsu\nmsu2\nnnsu\nnsu1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003espbifmo1\nmsu1\nmsu2\npermsu\nnnsu\nnsu1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003cbr\u003e\n Novosibirsk SU Contest #2, by Novosibirsk Team #1"}}]}