Who Wins Gold, Silver, and Bronze?

Time limit1sMemory limit128 MB

Problem

A ski event consists of two races.

In the first race, N athletes numbered 1 through N start one at a time in increasing number order. Whenever an athlete finishes, that athlete's current rank among all athletes who have finished so far is recorded.

After the first race, only the athletes ranked 1st through Mth in the final first-race ranking qualify for the second race.

In the second race, those M athletes start one at a time in reverse order of their first-race ranking: from Mth place up to 1st place. Again, whenever an athlete finishes, that athlete's current rank among all athletes who have finished so far is recorded.

After the second race, the athletes ranked 1st, 2nd, and 3rd receive the gold, silver, and bronze medals. Determine their athlete numbers.

Every athlete finishes the race, and no two athletes finish at exactly the same time.

Input

The first line contains integers N and M. (3 ≤ M ≤ N ≤ 100)

The next N lines give the current rank assigned when each athlete finished the first race, in order from athlete 1 to athlete N.

The next M lines give the current rank assigned when each athlete finished the second race, in the order that the second race was run.

Output

Print the number of the gold medalist on the first line. Print the number of the silver medalist on the second line. Print the number of the bronze medalist on the third line.