410076: GYM103938 D Hardcore Haircuts

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Hardcore Haircutstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

EGaDS has designed a new game, themed around a barbershop called Hardcore Haircuts.

In the game, Harry the Hairy Hairball wants a new haircut! The question, of course, is which one?

Harry has $$$N$$$ hairs and although he knows he wants one of them to be cut, he has forgotten which one. Now, Harry has entered your hair salon and is feeling quite harried, since he doesn't know what to ask for. He does, however have a sorted list of the planned lengths of each hair after the haircut, $$$v_i$$$.

Luckily, you can see Harry's head and observe the lengths of his current hairs. You've also written this down as a sorted list of lengths, given by $$$u_i$$$.

Given the desired lengths of his hairs $$$v_i$$$ and the current lengths, $$$u_i$$$ please determine which hair should be cut. Please hurry to help Harry determine which hair should be harvested!

Input

Line 1 is a single integer, $$$1 \leq N \leq 10^4$$$, representing the number of hairs Harry has.

Line 2 has $$$N$$$ sorted values $$$0 \leq v_i \leq 1000$$$, representing the desired lengths of his hairs.

Line 3 has $$$N$$$ sorted values $$$0 \leq u_i \leq 1000$$$, representing the current lengths of his hairs.

Note that exactly one hair will be cut.

Output

Two integers, denoting the initial and new lengths of the hair.

ExampleInput
3
1 2 3
1 3 4
Output
4
2 

加入题单

算法标签: