No tag edit access

D. Super M

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputAri the monster is not an ordinary monster. She is the hidden identity of Super M, the Byteforces’ superhero. Byteforces is a country that consists of *n* cities, connected by *n* - 1 bidirectional roads. Every road connects exactly two distinct cities, and the whole road system is designed in a way that one is able to go from any city to any other city using only the given roads. There are *m* cities being attacked by humans. So Ari... we meant Super M have to immediately go to each of the cities being attacked to scare those bad humans. Super M can pass from one city to another only using the given roads. Moreover, passing through one road takes her exactly one kron - the time unit used in Byteforces.

However, Super M is not on Byteforces now - she is attending a training camp located in a nearby country Codeforces. Fortunately, there is a special device in Codeforces that allows her to instantly teleport from Codeforces to any city of Byteforces. The way back is too long, so for the purpose of this problem teleportation is used exactly once.

You are to help Super M, by calculating the city in which she should teleport at the beginning in order to end her job in the minimum time (measured in krons). Also, provide her with this time so she can plan her way back to Codeforces.

Input

The first line of the input contains two integers *n* and *m* (1 ≤ *m* ≤ *n* ≤ 123456) - the number of cities in Byteforces, and the number of cities being attacked respectively.

Then follow *n* - 1 lines, describing the road system. Each line contains two city numbers *u*_{i} and *v*_{i} (1 ≤ *u*_{i}, *v*_{i} ≤ *n*) - the ends of the road *i*.

The last line contains *m* distinct integers - numbers of cities being attacked. These numbers are given in no particular order.

Output

First print the number of the city Super M should teleport to. If there are many possible optimal answers, print the one with the lowest city number.

Then print the minimum possible time needed to scare all humans in cities being attacked, measured in Krons.

Note that the correct answer is always unique.

Examples

Input

7 2

1 2

1 3

1 4

3 5

3 6

3 7

2 7

Output

2

3

Input

6 4

1 2

2 3

2 4

4 5

4 6

2 4 5 6

Output

2

4

Note

In the first sample, there are two possibilities to finish the Super M's job in 3 krons. They are:

and .

However, you should choose the first one as it starts in the city with the lower number.

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/18/2017 09:51:31 (c5).

Desktop version, switch to mobile version.

User lists

Name |
---|