AmeriDarts is a dangerous but full of glamour. Mr.cai wants to have a try.
The rule is simple:throw some boomerangs in a line from left to right as quickly as you can. You are asked to throw twice, first time throw A red boomerangs, second time throw B blue boomerangs. Your score is to calculate the shortest length of blue and red boomerang. This rule seems strange? so am I.
First there is two integer A(no more than 1000) and B(no more than 1000), then followed two lines consist of those A and B numbers.Note that these two array both in ascending order.
For each testcase, output the shortest length between red and blue boomerang in a single line.
1 2 3 4
5 6 7 8
5 12 14 15 16
1 2 7 8 9